It doesn't change the fact that you cannot hold onto land seized in a war!"
Actually, it does. Jordan, which had illegally annexed Judea and Samaria in 1948, opened fire on Israel from Jerusalem while Israel was battling the Egyptians and Syrians, and when the IDF entered Jerusalem to stop the artillery fire, the Jordanian army almost immediately fled across the river, abandoning Judea and Samaria to the IDF. Since Jordan was the aggressor, Israel was under no obligation to return it to Jordan, which, in any case had illegally annexed it in 1948; but Israel offered to in exchange for peace, but Jordan initially refused.
Syria had for years been lobbying mortar shells on the Israelis farms beneath the Golan Heights, and as a member of the Arab League, which had threatened in 1948 genocide against the Jews if they declared Israel's statehood, was committed to the destruction of Israel, and as the Soviets continued to build up the Syrian military, the perception was an attack was imminent and Israel had a legal right to strike first, so Israel was under no legal obligation to return the Golan to Syria, nevertheless it did offered to return the Golan to Syria in exchange for peace and every Israeli since has made the same offer, but Syria has continuously refused.
In Egypt, Nasser was a pan Arab nationalist committed to the destruction of Israel who kicked UN observers out of Egypt and built up a large military presence on its border with Israel while making fiery speeches against Israel and the perception in Israel and the US was that an Egyptian attack on Israel was imminent, Israel struck first. After the war, Israel offered to return the land it had captured from Egypt in return for peace, but Egypt initially refused.
Until the Arab nations were ready to accept peace with Israel, Israel was under no legal obligation to return any of the land it had captured.