I would guess that it is. My sons have had to sign similar agreements, so it appears to be legal in my state. I assume that it is also legal in yours.
Personally, I like it. It gives them a greater reason to say "no" to drugs or alcohol if they know they can booted from the sports team if they imbibe in whatever impairing substance is in question.
- Carl