Yes, same-sex classes should be allowed, for parents who want their children to participate in these types of classes. There is some merit to single-sex education. Parents who want the option should be able to select it for their children. The government can serve these children equally through this education option.
Sometimes, same-sex classes offer a better teaching opportunity than co-ed classes. There aren't any raging hormones or distractions from the opposite sex in said classes. Although not true to life where co-eds mingle freely, same-sex classes may be a more efficient way to get the point across to students in a public setting. It works for some universities, why not at public schools?
Some kids will go into school without ever meeting someone their age, which includes someone of the opposite gender. Some don't have brothers or sisters who they can look at for a guideline of what the other gender is like. It is VITAL that kids are included in co-ed classes, because if they go into same sex classes for the rest of their time in school (from preschool onwards), I guarantee you that some will come out never meeting someone other than teachers and parents of the opposite gender, and some will come out thinking that cooties are real.
One of the main things that you learn in school is how to interact with other people. Some kids get into school without even having a brother or sister as a template to study other people by. If there were such thing as gender segregated classrooms, especially in primary-secondary school, I guarantee you that some kids will come out never knowing a girl their age, and never realizing that there is no such thing as cooties.