I used to believe that a lottery was a "voluntary tax" and had no issue with it. I even encouraged it, although I've never in my life purchased a lottery ticket (because math, not morals).
Then I learned that this voluntary tax is almost completely funded by the poorest and most uneducated segment of our society. I now think it's less moral.
Regarding casino and sports gambling, I live in Gilpin County -- the only place in CO with casino gambling. For the last six years, I've paid far less taxes, far less, than my next door neighbor who lives in Boulder County. I had no issues with this, although I've never gambled in any of the casinos (because math, not morals). Side note: Gilpin is now coming after us homeowners in a big way to make up for lost revenue during the lockdown.
In the general question of "if the money benefits what I like, does the end justify the means?". well, I said above if it personally benefits me I'll at least turn a blind eye.
I don't personally have a problem with anyone who chooses to gamble. I do have a problem with systems that disproportionately prey on uneducated and poor people, whether by design or accident.
And.... I still think it's bad optics for a university.