All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
What the questioner mentioned is not puzzling. We are forbidden to swear by anything other than Allaah as He forbade us from doing so, but He does what He wishes and none has the right to dictate on Him what to do and what not to do or question what He does, as Allaah Says (what means): {He is not questioned about what He does, but they will be questioned.}[Quran 21:23].
The fact that Allaah swore by some of His Creations does not mean that that creation is greater than Allaah and no sane person would understand this meaning, as how is it possible that a creation would be greater or more important than the Creator?
Allaah swore by some of His Creations in order to show us His great Might, for instance He swore by the beautiful heaven which reflects His ability of mastering His creation. Allaah also swore by the setting of the stars and swore by other creatures. Moreover, when Allaah swears by something, this means that it has a great importance and that it is of great status. For example Allaah swore by the life of the Prophet as He Says (what means): {Verily, by your life (O Muhammad) they were wandering blindly in their wild intoxication.} [Quran 15:72]. There are also other significances in Him swearing by some of His Creations.
For more benefit, please refer to Fatwa 90961.
Allaah Knows best.