Germany's military goal in that war was to neutralize all the powers that could pose a threat to Germany. This explains why they attacked France and Russia which were the two other great land powers in Europe.
There is no clear reason why attacking and subjugating Switzerland could help Germany achieve that goal. Furthermore, the Swiss posed no threat to Germany as they were committed to being neutral.
During and before the war, Germany and Britain were fighting a diplomatic war where they tried to get countries to be friendly towards their side. After the war broke out, the Germans were not as diplomatic anymore, and they often just attacked countries that were getting too friendly with Britain. Switzerland, being so committed to neutrality, never drifted towards Britain in such a degree that Germany thought it threatening.
Also remember that occupying a country is very expensive and requires resources that could be used other places. Germany occupied Norway for 5 years in the war, and had to keep about 300000 soldiers there in order to maintain control. Those soldiers could be better used to fight Russia.
However, the Germans thought it was worth the cost to attack Norway because it gave them control over some of the North Sea, as well as securing some mineral resources such as iron.
With Switzerland or Sweden, the Germans did not think attacking those countries gave them any advantages that were worth the cost of occupation.