I dont see how it's invasive. Or complicated. The legislature wants to make sure that girls are not being forced to compete against boys.
You guys will probably end up spending more time bitching about it than the state will in passing/not passing it so I really don't see the issue about it being "necessary" or not.
Then codifying it isn't going to hurt anyone, now will it?
The current administration has signaled they intend on requiring states to allow the practice the legislature is trying to prevent.
The prevalence of it really shouldn't matter here either. If the legislature can agree that a practice that is happening around the country (even in small numbers) is not acceptable here, then making a law on the subject makes sense.