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.