The cases of Jerusalem and Jerosolym can be confusing to some. For instance, Saint Paul mentioned meeting Saint Peter in "Jerosolym" (Gal 1:17) but refers to "that Jerusalem which is above is free, which is our mother" (Gal 4:26).
After reading more cases of these spellings it becomes clear that "Jerosolym" solely refers to the capital of Israel while "Jerusalem" denotes heaven such as with St. John's books.
Saint John uses only Jerosolym in his Gospel (13 times), and he uses only Jerusalem in the Apocalypse (3 times). In his Apocalypse, Jerusalem always refers to the Holy City, which is Heaven.
The reasoning for this spelling difference is based off a play on words.
The y spelling (Jerosolym) derives from the Greek Hierosolym, which includes the Greek root for sacred cultic words. Hiereus is priest. Hieron is temple. The Greek writers made a Greek play-on-words to denote Jerusalem as a Hierosolym (a “temple” city).