Is it acceptable to publish student names with the label 'stupid question', on a publicly-visible website?
No. This is completely unacceptable. Sometimes faculty rant on social media and email lists where they do not think students will see the comments. Even this is frowned upon if the student could realize it is them being made fun of. It is completely inappropriate to make fun of students on a public website with students names.
In addition to StrongBad's answer, this kind of behavior would also discourage students from asking questions in fear of finding themselves on the “stupid questions and answers” list. Given that “unacceptable” wasn’t defined further in the original question, I think this is also an important aspect that makes this sort of student shaming unacceptable. Except if the Professor doesn’t actually want any questions asked of course :-)
I'd like to add that additionally, I don't think posting photos of test answers online (like this specific professor did) is ethical or even legal. According to this website (archive link), handwriting is personal data according to the EUs GDPR (General Data Protection Regulation) and can almost certainly not be published without permission.
It's not only that such ridiculing is absolutely unacceptable and counterproductive (as others mentioned already) but it also puts the academic themselves in a kind of bad light as a lecturer/teacher. If my third year math/engineering students didn't know what the cotangent is I would consider it much more of my own fault rather than theirs.
And most importantly, one shouldn't be embarrassed of not knowing something but of not wanting to get to know it. Most people don't even bother to ask a question even being proud of their ignorance sometimes. So I believe that no curiosity should be frowned upon.
UPDATE: Having said the above, it could still be considered a good attitude for a student to come up with some answer themselves (i.e. do some research/thinking) prior to asking their professor a question.