So nazi t-shirts should be legal too, by reductio ad absurdum.
But they are not , because they infringe the basic principles of any democratic society.
If you choose a "guiding philosophy" which embrace misogyny , you'll pursue it out of France.
Yes, Nazi t-shirts should be legal. People are entitle to their emotions, they're a basic part of being a human being. Hate is an emotion, and people are allowed to express that they hate something, including other people. Treating someone badly because of something like race and not a personal knowledge of the individual can and should be illegal, but the government can't tell someone what to feel.
On the other side of that, people who disagree with Nazism and bigotry in general have the right to be offended at the sight of a Nazi t-shirt and tell Nazis whatever thoughts they have about Nazism.
If someone with a Nazi t-shirt is on private property, like say in a cafe, and the cafe owner doesn't want people expressing Nazism or other bigotry in their shop, they have the right to ask the Nazi to remove the shirt or leave.
The idea that having opinions which fall in line with Nazism infringes on Democratic principles is absurd. Democracy is about everyone's voice being heard. If you live in a society that values justice and equality under the law, Nazis will be outliers and their views won't have enough support to influence laws or culture.
In any case, Nazism and Islam have little if not nothing to do with each other, but since you've brought Nazi fashion into a discussion about Islam influenced fashion, let's make an honest comparison of the two:
A shirt with Nazi logos, slogans, or ideas on it shows to an individual (but
not a government) that the wearer has a negative view of other people, and has an ideology that aligns with a political movement that asserted that blacks (people who looked different) and Jews (people who worshiped a different god, or worshiped the same god differently, and may or may not have looked different) were less than human, and not only advocated the murder of people falling within those groups, but also homosexuals (people whose sexual socialization was different) and communists (people who had a differing view of ideal governance of a society,) as well as other groups of people, and actively attempted to and successfully implemented policies and built infrastructure to carry out such murders. It's entirely reasonable that a person who values freedom and equality would see a garment with a fashion expressing such an ideology would be disgusted at such an outlook, and offended by another person expressing it. Nazism is directly opposed to liberty and equality.
Islam isn't the same, as Islam is a complex philosophy with several religions based around it, and many interpretations of that philosophy within those religions, resulting in many different ways of expressing and adhering to it. Those interpretations range from an outlook that requires tolerance, love, and care for all other people no matter what at one end, to murdering people who interpret Islam differently and/or don't practice it at the other.
Islam, like many philosophies and religions, touches on ideas of personal modesty, one interpretation of which suggests that it is ideal for women to cover most of their bodies in public.
Now, places where Islam is a predominant religion and philosophy have historically had fashions which look different from those in Europe, and people and groups of people that have immigrated from those places often wear fashions that are identical or have vestigial resemblance to the modern evolution of those fashions. We are discussing here a style of swimsuit which takes heavy influence from those fashions, and the banning of these swimsuits in several cities in a nation which considers its self liberated and valuing of equality.
These swimsuits show that someone wearing one likely interprets that the aspect of Islam which idealizes women covering the majority of their body in public is reasonable, and that the person has chosen to adopt that aspect of Islam for themself. The idea behind banning such a swimsuit is that the ban will allow someone that has adopted that interpretation to be more equal to other members of French society, because the people enacting the ban have made the assumption that someone who has accepted a particular ideal of personal modesty has also adopted an outlook which does not value or accept equality among men and women, or the right of women to make there own choices.
The complex nature of the Islamic philosophy and its many interpretations invalidates such an assumption, because this fashion does not imply any interpretation, acceptance, or adoption of any part of Islam other than its ideals of personal modesty. You cannot look at someone wearing this kind of clothing and know anything other than their interpretation of this singular, narrow aspect of Islam, the adoption of which does not relate to their idea of equality among men and women. What's more, although there is the strong implication that someone wearing such a swimsuit is a Muslim, you cannot assume that they are, because people in free societies can choose to wear any fashion for any reason.
Another aspect of the rationale behind that ban is that if you don't allow people to choose to wear certain fashions public, that they will be forced to accept values of freedom and equality among all people. To reiterate that,
this ban seeks to enforce ideals of liberty and equality by removing freedoms from a select group of people, specifically by removing the option of women in a minority group to wear certain fashions. That is entirely illogical.
You mention infringement of democracy, but enacting laws like these infringes directly on liberty and equality by restricting liberties, and justifying it by making assumptions that the government has no place to make and no way to support.