I can think of three different reasons why ⟨ß⟩ was discontinued in Switzerland. However, I do not know which one to prefer, and there may be other explanations. That is why I am asking.
Here are the three reasons I know:
1. Geistige Landesverteidigung
The modern antiqua ⟨ß⟩ was only introduced in the 1876/1901 spelling reform – unlike the blackletter ⟨ß⟩ (or ⟨ſʒ⟩) which had existed long before. That spelling reform was initiated in the early years of the German Empire (founded 1871), a time of great national enthusiasm and unification: one German victory, one German nation, one German Kaiser, one German constitution, one German currency. It was only logical that there should be one German orthography.
Swiss institutions (various cantons, the Swiss Post) discontinued the ⟨ß⟩ in the 1930s during the time of «Geistige Landesverteidigung» or Spiritual national defence, another time of national unification when Switzerland closed ranks against the raising Nazi Germany. The importance and independence of Swiss culture was stressed: the free mountain farmer, the direct democracy, the multilingualism, the watchful selfdefense against foreign powers.
I suspect there may have been a relation between Geistige Landesverteidigung and the discontinuation of ⟨ß⟩: since the antiqua ⟨ß⟩ was introduced in the wake of the German Empire’s foundation, it may have been associated with Germany. In the time of Geistige Landesverteidigung, the Swiss rejected everything related to Germany. Therefore, the antiqua ⟨ß⟩ was rejected as well.
2. Swiss typewriters
According to many sources on the internet, the reason for the discontinuation of ⟨ß⟩ was the lack of this letter on Swiss typewriters, which needed to accommodate for typical French or Italian letters as well.
I think this explanation is not very convincing. It could have been the other way round: Swiss typewriters might lack the letter ⟨ß⟩ because it had been discontinued. Also, given that the antiqua letter ⟨ß⟩ had only been introduced in the 1876/1901 spelling reform, it might have been too recent to be included on typwriters. I do not know the history of Swiss or German typwriter keyboard layouts.
3. Swiss German pronunciation
According to Peter Gallmann, the reason for the Swiss discontinuation of ⟨ß⟩ is in the syllable structure of Swiss German dialects: in the spelling of Swiss German dialects, the doubling of consonant letters is independent from the length of the preceding vowel.
Swiss German dialect spelling can have single consonants letters after short vowels (e.g. «sibe» ‘seven’ or «Ofe» ‘oven’) or doubled consonant letters after long vowels (e.g. «Huuffe» ‘heap’ or «Straasse» ‘streets’). This is unlike standard spelling German (with ⟨ß⟩) that does not allow single consonant letters after short vowels or doubled consonant letters after long vowels. Given this difference, the lack of ⟨ß⟩ in Switzerland is no longer a surprise according to Gallmann (see Warum die Schweizer weiterhin kein Eszett schreiben).
I think this explanation is not very convincing either. It may describe the conditions for the discontinuation of ⟨ß⟩, but it fails to explain why the discontinuation really happened. Blackletter ⟨ß⟩ had always been used, whether or not it fit Swiss German pronunciation, and antiqua ⟨ß⟩ was being introduced. Also, Gallmann adventurously equates ambisyllabicity (a concept of syllable analysis that does not have any phonetic correlate) with fortis consonants (a concept of phonetics), which makes his analysis rather confusing.