Nationalism is IMO deeper than that. To use a EU example, many people in Greece complain about countries that are giving them money. “How dare they attach strings when handing us money!!!” That’s nationalist in ways I have trouble understanding.
It's really just a time filler to cover the gap between when classes end and a school game begins. Growing up in the US I think we had ~1 or 2 per year from ~8th-12th grade. They were also generally fairly short as in 10-15 minutes with I think one lasting 45 when the other team was late.
PS: Most games did not take place during the school day, but I think they scheduled a few that with a small overlap if a team would otherwise get home really late during a week night. I think there much more common in low density areas for this reason.
Edit: Though like all such traditions it's been morphing for a while. With some schools holding them before big events and or in the middle of the day.
I couldn't imagine my school in Scotland doing anything similar (and we were a very sporty school, with compulsory attendance at a lot of inter-school games, which I mostly sneaked away from).
But turn that into mindless yelling and that's just a pissing contest. It's ignorant of what other countries have to bring.
To give you a concrete example: I'm french. There's a lot of things I'm not proud of from my country. I'm proud of my language; French is beautiful. But I also make an effort to learn the language of every country I live in. I have fallen in love with Swedish. Had I been in a pissing match telling everybody (but mostly myself) how amazing French is, would I have gotten the chance to learn any other language? Would I have gotten the chance to even write my thoughts, in English, on this very forum?
This is a relevant example because, in France, a lot of people have that attitude of being too proud to learn another language. It's one of the recurring tourist complaints about France, in fact! I see this as no different.