Present a written response to the write up and ask that it be attached and become a permanent part of your personnel file.
In it include something like, that while you may have been in attendance for some inappropriate conversations, you were not an active participant, and that in the future you will walk away from any conversation as soon as anything inappropriate is uttered in your presence. Include that you strive to maintain professionalism in all that you do, value your co-workers and the team, and plan to move ahead with a positive attitude.
Yes, I have been a manager. Yes, I have written up the entire group - sometimes in order to make a point - and in cases where culpability is unclear. But, I always respected a team member who answered the write up in a clear, professional manner, leaving personal feelings aside.
It is unfair that the entire team has to be reprimanded for the actions of a few. But, the best advice I can you is to maintain your professionalism and set aside your personal feelings when responding to the matter. This is what I would do whether I was the manager or the staff person.
Good Luck
God Bless