deny joining side / force join side

In the module I’d like for there to be a way for all players to be forced into spectator, when an action occurs it forces them to a specific side, and after all players that will join have, they can click a button to lock all sides from entry bar observer. is there a way to do this?

This is the sort of thing that Vassal is typically very bad at. No, there is no way to dynamically manipulate the ‘sides’ that you define in the module editor. You might be able to fudge things from the other end, though I don’t know how satisfying it will be: say you want sides red, green, and blue. Have the players choose, instead, sides P1, P2, and P3, then after the event, distribute the red cards to one player, the green cards to another, and the blue cards to the third. Maybe update some layers in a status window somewhere to show who got which side. Note that this would be a huge pain to set up, and it probably wouldn’t do everything you want it to.
So why not just allow the players to join ‘observer’, use reports to tell the players who should get which side, and then let them switch on their own? If the concern is PBEM security, well I just don’t know much about PBEM. Maybe the wargamers will have some thoughts on that.