Asalaamu alaikum sister!
Well first off, men and women do NOT have to be separated by different ROOMS in a masjid. During the time of the Prophet(saws), the women would just be in rows behind the men. However, some masjids(many) do indeed have different rooms to keep it more modest and such. There is nothing wrong with that!
Anyways sister, when we do prayers, we do all kinds of movements, like bend down, etc. Certainly you do not want to be surrounded by a bunch of men when you do that! Even during my yoga class at the YMCA they have women in the back because they know it is a little immodest to have a woman doing yoga with all those moves, in front of a whole bunch of men!
It is all for the purpose of modesty. Prayer is *very* important in Islam, and it is our direct connection to allah(swt.) We should not get caught up with materialistic things while praying.
I know Islam seems a little strict in some of these measures, but know that Islam is for all people, all over the world. Here in the USA, we find nothing wrong with a man sitting by a woman. Go to Afghanistan, and I promise you that it is totally not the case! If a woman sits next to a man and they are not mahram, that man is probably thinking non-stop of that woman, and in a lustful way.
Anyways, the scholars have explained this issue much better than me, and feel free to PM me if you would like me to fetch up some links for you.