The answer is: It depends on the canton and sometimes on the municipality (
legal background in German). Most cantons tolerate a one-night sleep-over on public parking ground if it isn't in breach with the site's general parking rules. You can get a very detailed
overview here.
However this might be a little cumbersome depending on the region you have in mind. In rural areas there are ban on drivings and parking space might be rare. In the cities many parking spaces have low time limits.
All in all I'm not sure if a campervan is the best choice for budget travel in Switzerland but I've never tried it myself.