It's not even about some sort of loyalty that conflates football and a diploma since the two realistically aren't related. For me, it's about making friends as a student and going to games with them and having an enjoyable time at games and therefore becoming invested.
Fully admit, the first couple times I went, it was just because friends were there, and even though I was a Ute fan, I wasn't going to be the jerk rooting against BYU with the rest of my friends there. I wasn't really rooting for them either, more just enjoying a football game without rooting interest.
But then I started wanting them to win for my friends' sakes; and then I started wanting them to win because I knew the team better and the strengths and weaknesses; and eventually, I started wanting them to win because they were my team. That's how going to a school makes you a fan of a team (even if the team isn't very good - which BYU wasn't during my time there).
I know that Utah has more commuters than BYU, but students there also have friends they make at college, so I'd imagine similar things happen for them.