I'm only familiar with Bird Law, and as there are no birds on the moon, I am sure that "rock law" will predominate in that if I hit you over the head with a big enough rock, I then obviously own the moon.
Err.... I just gave an example of one that wasn't "ignored". The world was divided up between Portugal and Spain by the Pope, never mind that most of it was largely unknown to Europeans at the time, and never mind that it was already populated by millions of people with their own countries and rules of land ownership. And the treaty was effective, to a very large degree. South America is almost entirely Spanish-speaking (except for Brazil, which wound up on the Portuguese side of the line). Many African and Asian countries (former colonies) speak Portuguese.
Not only was it not "ignored", but it's still effective 500 years later.
If such a treaty can be applied to inhabited lands, what makes you think one can't be applied to the lifeless terra nullius of the Moon?
Your very link shows a number of times the treaty was ignored.
The treaty you point out found its inception from a treaty that wasn't followed from less than a decade prior! This is even explained in your link.
And for the treaty itself, this is mentioned, "It was superseded by the 1750 Treaty of Madrid which granted Portugal control of the lands it occupied in South America. However, the latter treaty was immediately repudiated by the Catholic Monarch. The First Treaty of San Ildefonso settled the problem, with Spain acquiring territories east of the Uruguay River and Portugal acquiring territories in the Amazon Basin. Emerging Protestant maritime powers, particularly England and The Netherlands, and other third parties such as Roman Catholic France, did not recognize the division of the world between only two Roman Catholic nations brokered by the pope."
There is also this very important point about how this treaty was followed, "It did not specify the line in degrees, nor did it identify the specific island or the specific length of its league. Instead, the treaty stated that these matters were to be settled by a joint voyage which never occurred."
You are confusing the self-interest of countries with a non-existent requirement to follow words on paper. Countries follow treaties to the extent of alignment with their own interests. If treaties were always followed by countries, then this world would be a far different place than it is today. There would also have been far fewer agreed upon treaties.
"Your very link shows a number of times the treaty was ignored."
And yet it largely remains effective. Despite all the things you mention, people still speak Spanish in the Spanish half. Ask the Aztecs, Incas, Mayas... how pragmatically effective the Pope's grant was.
I'm really not sure what your argument is here.
"The power goes out once in a while, therefore electricity is useless"? "Doctors can't always save the patient, therefore medicine is useless"? "People sometimes murder, therefore we should not have laws against murder"?
My argument is what I originally wrote, "Treaties on Earth have very little meaning. They have zero meaning on the Moon." That argument is supported by the contents of your link.
You posted a link to show a treaty that has been in force. However, your link shows the exact opposite of that. The treaty has never been in force, was started because an earlier treaty wasn't followed, and has been superseded multiple times by other treaties.