Disclosure: I've played in a lot of bands, in a variety of styles.
Not caring about what others think you look like is about as close as you can get to a definition of “cool”!
If you’re a young white male worried about being seen dancing because of a stereotype that’s a problem with you; dance is human heritage and everyone’s allowed to do it. I genuinely believe the whole “white people can’t dance!” thing is rooted in white people being self-conscious because they’ve been dancing to black music for the last 100 years instead of waltzing to the classics, not to mention the comparatively censorious attitude towards dance in White America versus Black America. Be the change etc. etc.
When a culture ridicules something it's not the person facing ridicule's fault for doing it less. Not a good faith take at all, and I doubt you would apply that take to other situations. Especially when we are discussing why people stopped doing something.
Having been a young white male ridiculed/joked about, I believe it's rooted in the actual countless jokes/ridicule/and mocking, not some weird white guilt. Again I don't think you would make this argument apologizing for ridicule in other situations. Young people have shown they don't care about arbitrary racial lines people like you want to emplace when it comes to the music, so why dancing?
The only place I was accepted and encourage was at Salsa clubs. I think in huge part because it didn't have the American cultural stigma of 'white boys can't dance', it just had 'let's all friggin dance'.