The 6-3 decision could have a broad impact, as 25 states have laws on the books restricting transgender athletes