Gender, nationality, age (actually birth date) and even a photo are all standard content of a traditional Swiss CV  and asking for this information is perfectly legal. US anti-discrimination legislation as discussed in some comments is not relevant when applying in other countries. Inform yourself about employment laws and customs of the country you want to work in; there are usually helpful websites for expats.
It appears you have been applying to companies that are a bit more traditional. I recommend providing them with the information they ask for if you want to work for them.
There are of course many questions that they can't ask you in Switzerland (as in most European countries) such as if you have illnesses (if those aren't relevant for the type of work, e.g., food allergies for a cook), are pregnant (or have plans to become pregnant), sexual orientation, ...