Non-transferable class registrations decided by lottery would solve this. Publicly visible, physical random number generation is important of course.
With pre-registration you can also get an idea of demand in advance, instead of having to post-hoc schedule additional classes (or concert tour dates, or airline flights, or PS5 units, or… etc.)
Non-transferability means the lottery is continuous. As soon as anyone relinquishes their class, the lottery will have to run again to reallocate. You could do this daily.
This is a technical solution that works but it overlooks the cultural side of a resource allocator wanting their resource to generate hype and demand, build up to the Big Event, and then sell out in “record time”. I can understand that a big part of University marketing is to try to seem as popular and oversubscribed as possible, even if I don’t agree with it.
Finally of course, the public RNG bit feels like the most interesting. A giant continuous dice tumbler in the middle of UW’s Red Square? The tumbler feels easy, but how would you make a physical ledger to record the dice rolls automatically?