This is not a valid method because there is an implicit bias in the sampling method. This is because people at a basketball game are more likely to enjoy basketball than those who don't attend.
A better way to determine the actual most popular sport would be to randomly sample students during the school day. This would give you a better representative sample.
A because it’s a an event the only people that like basketball would go to plus not everyone is there so it doesn’t prove it’s the more popular sport in the whole school just at that championship