Double letters serve a function--usually to make a vowel short. Sometimes with the case of ss, it changes the sound of the 's' from a (z) sound to a (s) sound. When the s comes at the end of a word, it usually takes the sound of (z). Think of the words has, was, his, days, etc. Therefore, using the double ss ensures the sound will be (s). Think of the root word for harassment, harass. If the s were alone at the end, it would sound like haraz.
These are just basic phonics rules that we are not taught explicitly in school.