Being a North American country and aligned, by and large with US??
NATO stands for North ATLANTIC Treaty Organization, not North American.
It is a treaty of mutual defense originally formed around the idea of protecting Europe from attack, specifically by the Soviet Union and later the Warsaw Pact. To quote first NATO Secretary General, Lord Ismay, the organization's goal was "to keep the Russians out, the Americans in, and the Germans down."
The question implies that NATO is a US-centric organization. It is not. It's centered on north west Europe (since expanded). NATO was formed to bring the US into the existing mutual defense Treaty of Brussels between Belgium, France, Luxembourg, the Netherlands and the United Kingdom. Its headquarters was in Paris and now Brussels. While the Supreme Allied Commander Europe has always been a US officer it is an international organization focused on Europe.
Mexico is not a member because it has no stake in those things. It was not a country threatened by the Soviet Union, nor is it militarily and politically associated with the other members. They were only tangentially involved in World War II and have no need for a mutual defense treaty, and the associated costs and entanglements, with countries and a conflict that is literally half a world away.
There are only two North American members, the US and Canada; the rest are European. That little blip in South America is French Guiana, a part of France. The US because they were a major Ally in WWII and politically linked to the defense of western Europe against Communism, and Canada because of its political and military ties to the UK.