Lets look why the use of the F-word can be considered a disqualifying foul. The NFHS and NCAA rules approach this situation in different ways.
NFHS R4-S19-A4: A flagrant foul may be a personal or technical foul of a violent or savage nature, or a technical noncontact foul which displays unacceptable conduct. It may or may not be intentional. If personal, it involves, but is not limited to violent contact such as: striking, kicking and kneeing. If technical, it involves dead-ball contact or noncontact at any time which is extreme or persistent, vulgar or abusive conduct. Fighting is a flagrant act.
NFHS R10-S3-A8b: A player shall not committ an unsportsmanlike foul. This includes, but is not limited to, acts or conduct such as: using profane or inappropriate language or obscene gestures.
NCAA R4-S25-A4: Flagrant foul, live ball. A flagrant foul shall be a personal that involves severe or excessive contact with an opponent while the ball is live.
NCAA R4-S25-A5: Flagrant foul, dead ball. A flagrant foul shall be a direct technical foul when it involves either unsportiing conduct that is extreme in nature or severe, excessive contact against an opponent while the ball is dead. A5a: An exception is a foul by an airborne shooter.
NCAA R10-S5-A2: Direct Technical Fouls for Unsporting Player Conduct. Unsporting tactics of players include, but are not limited to the following: Using profanity or vulgarity; taunting, baiting, or ridiculing another player or bench personnel; pointing a finger at or making obscene gestures toward another player or bench personnel.
NFHS rules state that vulgar conduct is a flagrant foul. NCAA rules state that using a vulgarity is a direct technical foul. I would hope that nobody would disagree that the F-word is a vulgarity. That being the case, disqualifying a high school age player for using the F-word is a no brainer. I find that disqualifying a college age player for using the F-word because we should expect better behavior from a college educated person.
Playing for your school or college team is a privilege. Part of competing in sports is controlling one's emotions. If one cannot control his/her emotions within acceptable limits then that person forfeits his/her right to compete.