I think Harvard's CS50 hands out yellow rubber ducks to students for free.[1] I see now that you can buy them online, too.[2]
Besides what the sibling post is saying about tuition being earmarked separately from merch, your peers wearing/hauling around course-related merch could also strengthen your impression that the course is good. Therefore you give better course evaluations, which helps your lecturers.
(Lecturers are adjunct faculty which is generally a bad gig.)
[1] https://cs50.harvard.edu/x/2022/
[2] https://www.theharvardshop.com/products/ddb50rubberducks
It's easy to distance yourself from the cost of tuition when it's paid for through a loan (with predatory interest rates, and no escape through bankruptcy).
Meanwhile, the swag is bought with 'your' money, to support the artist (and good teachers are artists, in the most positive sense of the word).