Synagogue
Among other reasons, the seating of men and women seperately stops any determination between those who are married and those who are not. Seperating couples allows for services to be a time with the community as well as a time for prayer. It is also believed in Orthodox Jewish communities that this seperation allows concentration to be more fully on prayer rather than on impressing someone else. A mechitzah, or boundry may be place between two areas for men and women although it may be more of a metaphorical boundry in certain cases.
Dance
The seperation during dance comes from the belief in modesty as well as the belief of preserving the boundry between men and women except in marriage. A mechitzah, or boundry is placed between the men and women's sides during a wedding and dance circles of only men or only women are common at some denominations of Jewish weddings and required at Orthodox Jewish weddings. Even the wedding dance the horah takes place seperately with the bride and groom connected only via the cloth they hold at either end.
In the show, the characters do not attend Synagogue, but rarely do unmarried male and female characters publicly spend time with one another in alignment with this tradition. For this reason, every time Motel and Tzeitel as well as Hodel and Perchik spend time with one another, it is done in breaking with this tradition.
During the wedding, much of the dancing will take place seperately and any actor who is playing a male character should dance on the male side regardless of the actor's gender.
When Perchik asks Hodel to dance with him and other guests join in, this is a major break from tradition and he knows it. When Tevye joins the dance it is accepting this break from tradition, one more step outside his comfort zone when it comes to strict tradition.
Chen Malul, C. (31 Oct 2022.) Separation: The Origin of the Women’s Section in the Synagogue. Retrieved from: https://blog.nli.org.il/en/ezrat_nashim/
Joseph, N.B. (n.d.) Mechitzah: Separate Seating in the Synagogue. Retrieved from: https://www.myjewishlearning.com/article/mehitzah-separate-seating-in-the-synagogue/
Krueger, A. (6 Jan 22) What to Know About the Jewish Hora Dance. Retrieved from: https://www.brides.com/hora-dance-5069553
Moss, A. (n.d.) Separation in the Synagogue. Retrieved from: https://www.chabad.org/library/article_cdo/aid/160962/jewish/Separation-in-the-Synagogue.htm
Weisberg, C. (n.d.) Why are men and women separated at Chassidic weddings? Retrieved rom: https://www.chabad.org/library/article_cdo/aid/504534/jewish/Why-are-men-and-women-separated-at-Chassidic-weddings.htm