This is a bit of a naive or maybe affluent take? Like, theoretically, I agree. And I myself was curious. But most people, by and large, are going to university because they know they need a degree to get a job, unlike their parents or grandparents. And even "the degree" is quickly becoming devalued in this current AI age.
I would guess that if all basic needs were met through UBI, the fraction of individuals going to school would drop and the makeup of subjects they pursue would change. Probably more cooking and art classes and less stem. Although, if UBI existed and AI did not, we'd probably see more educated individuals in the first place so maybe there would be an uptick in stem attendance and general curiosity in such a utopian world.