In a world full of bad news, North America has been having quite a good run lately. Energy production is off the charts in the U.S. and Canada, and much-needed political and economic reforms are steadily advancing in Mexico, while fewer Mexicans are moving to America.

Given the Obama administration's lack of progress in other parts of the world, one might expect it to seize on the obvious opportunities on our nation's doorsteps. It has not.

During his six years in office, President Obama has been to Saudi Arabia more times than he has been to Canada. In February, a panel of former top Canadian diplomats was asked to comment on the state of U.S.-Canadian relations. "Unfortunately," said one former emissary, "of modern presidents, Barack Obama appears to have the least appreciation of the strategic importance of Canada to the U.S. He has not put the necessary effort into the neighborhood, including Mexico, that it deserves."

Former Ambassador Allan Gotlieb, the dean of Canada's diplomatic corps, faulted Obama for a "striking lack of sensitivity" to "the impact of their [Keystone XL] position on our historic joint energy relationship, our joint economic security interests and the uniquely integrated economic ties with the country with which they share a continent."

It is hard to overstate what is at stake. The United States is now the world's second-largest producer of oil and natural gas and has the fourth-largest proved gas reserves. Canada has jumped to the fifth-largest energy producer and controls the third-largest proved oil reserves. Although Mexico's energy production has fallen over the past decade, it remains the 10th-largest oil producer in the world. The three North American countries together account for almost a quarter of the world's oil and gas production.

Meanwhile, Mexico has made dramatic strides since the North American Free Trade Agreement was passed in 1993. A majority of its population is now middle-class, and President Enrique Peña Nieto has made steady progress on major reforms in the energy, education and financial sectors. Drug-related violence and corrupt governance remain huge problems, but the steady economic progress and slow strengthening of Mexican institutions show a way out of the cartel-led chaos. While illegal immigration remains a hot topic in the United States, a plummeting birthrate in Mexico over the past 50 years has already shown up in much lower net migration rates since 2007.

On the surface, our bilateral relationship with Mexico is in better shape than the one with Canada. But apart from continued security assistance through the Bush-era Merida Initiative, there is not much to talk about. Although the two countries created a high-level economic dialogue in 2013 with lofty goals, its output has been an assortment of average achievements: shorter border wait times, student exchange programs and "entrepreneurship training sessions."

After the failure to secure a permanent immigration deal with Congress, Obama has delivered nothing of real value to the Mexicans. Peña Nieto's last meeting with Obama was noticeably void of substance and focused on mid-level issues. Not surprisingly, Mexico is taking its trade business elsewhere. It has used its 40 bilateral free-trade agreements with other countries as a magnet for high-skilled manufacturing that might have located in the United States. In the past six years, at least seven major auto manufacturers have built plants or expanded facilities in Mexico.

The trilateral relationship is in even worse shape. The annual meetings of the North American "Three Amigos" have become more like the Three Acquaintances. Canada canceled the 2010 meeting, Mexico pulled out of the 2012 summit and the leaders decided not to meet at all in 2013. Last year's meeting in Toluca, Mexico, produced disappointingly little. One Canadian commentator summed up the meeting as "not a disaster." The 2015 summit, to be hosted by Canada, has been postponed until "later in the year" at a location to be determined, according to Canadian officials.

The administration's unneighborly aloofness poses real problems. First, Mexico's encouraging political and economic gains are not guaranteed. Peña Nieto still needs lots of U.S. help to ward off security threats and improve the rule of law, human rights and border infrastructure; it is not enough for Obama to attend a few meetings and hope for the best. Second, by giving Canadian Prime Minister Stephen Harper the silent treatment and bottling up huge energy projects such as Keystone XL, the White House is driving our largest trading partner toward more reliable buyers and suppliers in Asia. A confidential 2012 Canadian foreign policy document recommended that, "to succeed [in China] we will need to pursue political relationships in tandem with economic interests even where political interests or values may not align."

As our largest trading partners and as countries fundamental to our border security, our North American neighbors and their challenges should be at the top of any administration's to-do list. Policy choices have consequences, and Obama's choice to distance himself from some of our best friends is costing us dearly.

Richard G. Miles was the National Security Council's director for North America from 2007 to 2008. He wrote this article for the Washington Post.