In the first crusade they went to Constantinople and then attacked nicea first before attacking Jerusalem but why would they go to those two cities if they’re not considered part of the holy land?
The First Crusade was launched because the Byzantine emperor, Alexios I, asked the Pope for military help to fight the Seljuk Turks. The Turks had invaded most of Anatolia, including Nicaea, which was not far from Constantinople. Before the crusade actually started, they had probably already decided to keep going to Jerusalem, but the original objective was actually to help the Byzantines.
The various groups that left from different parts of Europe all agreed to meet at Constantinople, which they did throughout the summer and autumn of 1096. Alexios realized they were going all the way to Jerusalem, but now that he had this massive army, he figured he might as well use it. The crusaders probably didn’t care about Nicaea, but the Byzantine guides that Alexios sent with them took them on a detour to Nicaea first, and they managed to recapture it in June 1097. But since that’s not what they were there for, they were happy to hand it back to Alexios and continue toward Jerusalem.
The other reason they had to go to Constantinople first was that there really wasn’t any other way to get to Jerusalem at the time. They had to walk there, through hostile Seljuk territory. After the First Crusade, the crusaders controlled some of the ports at the eastern end of the Mediterranean, so now it was possible for ships from Europe to sail to friendly harbours. Thanks to the involvement of the Italian city-states, who recognized that this was a great economic opportunity, the sailing routes from Europe to the crusader ports in the east became well-known and well-travelled. Eventually, sailing to the east by ship was a much safer and faster 5 or 6 week trip, as opposed to the many months or more that it might take to walk there.
So, in short, it was partly because the sea route wasn’t available yet, and also because the crusade was actually intended to help the Byzantine Empire first and they had all agreed to meet up at Constantinople.
For a good history of the First Crusade, see:
Thomas Asbridge, The First Crusade: A New History (Oxford University Press, 2004)