This is a complicated and difficult thing to consider - I think it's easy to take a lot of our natural suppositions for granted in instances like this, without considering that when you're dealing with people from a foreign culture, and a foreign religion, they likely don't take for granted the same things we do - and they themselves take for granted some things that maybe wouldn't even cross our mind.
For instance, in the first place, it appears that they're talking about a public school, which makes things very different than if they were attending a private school; in the private school case, the law probably would have never been involved in the first place. Since the school they attend is a service provided by the state, then the ruling by the European Court effectively states that "These individuals' religious beliefs are less important than the state-mandated education they must receive".
Here in the United States, religious liberty is one of the most important rights guaranteed by the Constitution. When you consider what rights are in the first place, they're designed to be trump cards individuals can use against their state body. When the state makes some kind of decision or ruling, if they are acting in a way that damages one's rights, that individual can pull out their trump card and say "You can't do that to me, I have a right to "X", and it forbids you from doing that without my consent."
The parents of these girls objected on religious grounds; if it is a state-sponsored school, and if the right to religious freedom is held as important, than it is my stance that the state must accommodate those beliefs as best they can. It did appear that they made some efforts to do so, but ultimately decided that it wasn't worth the effort. There are still other alternatives - maybe the girls could attend another class in that period, or do some other activity, like running, instead of swimming; I don't know the details and this report is woefully lacking in details.
So a ruling like this sets a dangerous precedent, I feel, in that religious rights now can be ignored by the state (at least in Switzerland) in certain circumstances. The big questions now are something like - what are the long-term ramifications of this? In what other cases can religious freedom be overridden in the name of "the functions of the state"? And what other rights can be curtailed in the future if these rights can be? I think when you make seemingly minor decisions like this, you can sometimes set a dangerous precedent, and you will often times end up going much farther down the rabbit hole than you ever intended.
The idea of separation the religious conservatives promote is something that I find very evil and I could not be happy in such society.
I don't know how I think about this yet. If I was Muslim, I'd be pissed but at the same time I understand the ruling. I'll be interested to see how this develops.