Look, I agree that some players/fans/coaches can be royal pains, or worse. That said, short of credible threats of violence against players and/or officials, and/or overtly racist/sexist comments ...
Any referee who walks out on a game -- AND EFFECTIVELY PENALIZES HONEST ADOLESCENT PARTICIPANTS AND MANNERLY SPECTATORS WHO PAID ADMISSION -- because of something a single rogue spectator says ...
Should find another hobby.
You turn off your rabbit ears, make note of the spectator, then work out any significant problem through a cooperative effort between your professional association and the school's administration. Then again, when said association doesn't consistently evaluate and discipline its own for poor performance and/or misconduct, how can it have credibility in dealing with spectators?
In short, I have been at hundreds of club, academy, high school, college and professional matches over the years, and (especially at the H.S. level) I've witnessed as many "problem" officials as "problem" spectators. The difference is, the big-mouthed spectator paid his way in, while the lousy official takes a check on the way out.
Should players and coaches have the privilege of walking out on a game when they're being home-jobbed, big-timed or shined-on by an official?
The correct answer is accountability and respect for ALL involved. If it isn't easy being a ref, imagine how hard it is for some parents to make a 150-mile round trip on a school night, only to see three presumed "professionals" sleep walk (or worse) through a match.
I've been there, brother. And it stinks.