Isn't this also how a lot of friendships start? People finding themselves in a similar place/situation/habit/interests. So to me it seems a bit natural that workplace friendships would naturally develop. It's healthier to make an effort to have friendships outside of work as well, of course.
Maybe I'm being naïve, but I don't see how "toxic atmosphere and disruption of team dynamics" would result from these casual friendships. If anything, I'm more likely to hold myself accountable to my team members when I know them better personally.
FWIW, I've built and strengthened plenty of friendships with coworkers via Teams, which obviously, I've used a lot more during the pandemic. This shouldn't seem that weird... I've made plenty of lasting long term friends over the Internet too.
Within time cliques form and some people may be coming to those events out of fear they'll be missing out instead of to have fun and some people may just not be coming and will be viewed by other team members as weirdos. From there it is natural to side with something you know and feel affection to and you may be unconsciously treating people who don't socialise with you worse than the others.
Other things that may happen, often when also alcohol is involved, people may say things from their private lives that then other people may use against them or when you start talking about politics and it turns out some people have completely opposite views to yours. This is not helpful in any way.
Maybe I'm being naïve, but I don't see how "toxic atmosphere and disruption of team dynamics" would result from these casual friendships. If anything, I'm more likely to hold myself accountable to my team members when I know them better personally.