Yes, this is halacha.
One source is the Shulchan Aruch (Siman 151:5)
If the synagogue has two entrances, one should not enter through one to make a path to the second one to shorten your route. If there was a path there before they built the synagogue, it is permitted. Similarly, if one didn't enter initially to take a short cut, it is permitted to make a path. When you enter to pray, you can leave from a different way than you came.
The Shulchan Aruch originated from Beit Yosef (Orach Chaim 151:5)
And our rabbi's mash and when he enters it to pray a mitzvah for those who enter at the door is to leave through a different door and my testimony is in the Gemara (90) from Dakhtib and when he comes with the land before the Lord at the times he comes through the north gate to bow down and exits through the Negev gate and the rabbis enforces a mitzvah to do kapandria and this is our rabbi's version
Note: This is the Ezekiel verse you started with
The Beit Yosef originated from the Tur (Orach Chaim, Siman 151:1)
and when one enters it, to pray a mitzvah for those who enter through the door, it is allowed to go out through another door
And there is also Rambam (Hilkhot Tefilla 11:10)
One who entered a synagogue to pray or read Scripture may leave at the opposite door to that by which he entered, in order to take a short cut.
I found the Rambam using this article, though they don't source it correctly (11:10 not 11:8)
Regarding "making a shortcut" through a destroyed synagogue, the Rambam (Hilkhot Tefilla 11:8) and the Shulchan Arukh (151:5) rule that if a beit ha-keneset has two doorways, one should enter through one and exit through the other in order to save time. In his Bei'ur Halakha, the Mishna Berura discusses, and ultimately prohibits, using a beit ha-keneset as a shortcut while traveling to perform a mitzva.
All of this, however, concerns synagogues and not the Temple.
The Rambam, in Mishneh Torah The Chosen Temple (7:2) does write about this in regards to the Beis Hamikdash:
One should not take a shortcut through the Temple Mount, by entering from one gate, and leaving from the opposite one, in order to shorten the way. Rather, one should walk around from the outside, entering only for the purpose of a mitzvah.
I found that halacha using this article by proxy, as they mention a related law (6:14) instead of the one we are interested in (7:2)
Someone entering the area where the Beis HaMikdash once stood is chayov kareis, an extremely severe punishment. 1
These translations are from Google Translate, so if anyone knows Hebrew well, translating the Beit Yosef may give more clarity as to its meaning. But clearly, the Beit Yosef is referencing that verse from Ezekiel.