An exercise like this should always happen when a team changes (since every addition or subtraction on a team gives you a new team), should be mandatory, include the whole team, and never be on weekends.
I guess you also mean that it should never be outside of working hours. It's quite not okay to make anything mandatory outside business hours. In most cases it's not even legal I assume.
By the way, why do you think a team building should be mandatory?
It could be outside working hours, like when you do a retreat on thursday to friday or similar, where you travel a bit farther to get away, and say over night.
Hmm, I'd say mandatory in a way that it should only happen when every team-member can attend. I don't see much value in having only a subset of the team doing the TB.
I'm assuming a team of 5-10 people. Of course there are other versions of TB, like a big event for lots of teams or whole companies for example. I hosted such an event once, we did Duct-Tape-Tower-Contests, and the older teams (as in longest time since forming) performed best.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.