Why is Mexico so poorly industrialized, although it is in close proximity to the technologically advanced and financially expansive United States? Why does US capital prefer to migrate to China and India rather than to its neighbor country?
Why some countries are poor and others are rich is one of the fundamental questions in economics, going all the way back to Adam Smith. There is a whole wealth of literature on the subject, but to simplify greatly the three main sources of economic growth are resources, technology, and institutions.
Mexico has a reasonably large quantity of of natural resources: oil, minerals, and arable land. It's geographically situated for easy trade with the world's largest economy and there aren't any trade barriers. Contemporary capital markets are fairly competitive and seem to be willing to invest in less developed countries (see South Korea, China, Brazil, etc), so lack of potential for investment doesn't seem to be a barrier to growth. Likewise, Mexico has access to roughly the same technology as the rest of the world.
In my eyes, the biggest problem is the institutions. Mexico is plagued by corruption, crime, and violence. In places where criminals can kidnap and ransom employees, steal property, or extort money, foreign and domestic firms are more reluctant to invest money. Furthermore, individuals are discouraged from investing in small businesses, because they know they might just have their livelihood taken by criminals or corrupt officials. Likewise, if thugs and criminals are the ones who are succeeding in a society, it makes less sense to invest in an expensive education: joining a criminal gang is easy money. This inability to make long term investments hurts the ability of individuals and businesses to expand the capacity for Mexico's people to provide higher value goods and services which, at the end of the day, is what creates economic growth.
Of course, the story isn't completely dismal: many parts of Mexico are doing just fine, American firms do move their manufacturing or call centers to Mexico, and the economy is growing. There isn't an easy solution for corruption and crime, but the better the government is able to establish clear property rights and rule of law, the faster the economy will grow.
Actually, to reiterate more forcefully a point that has already been made, the premise of your question is simply wrong. Mexico isn't particularly poorly industrialised.
In terms of purchasing power parity per-capita GDP (a good way to measure living standards) and depending on the year/source you look at, it's somewhere between the 60th and the 70th spot among all the countries in the world. It's slightly below Brazil, Russia, Turkey, Croatia and other poor European countries, usually above Bulgaria and several times richer than many countries in Africa or Central America. In Latin America, only Chile and Argentina are significantly richer.
And Mexico is high on the list of destinations for US foreign direct investment (after rich European/OECD countries), possibly above China, certainly above India. As a whole, the country receives more foreign direct investment (not only from the US) than China, if you account for the population difference. In this, like in many other things, a major factor is that China is simply unfathomably huge.
Obviously, Mexico isn't the richest country on earth and the US and Mexican economies haven't converged but there are many countries doing much worse and no evidence that Mexico is an anomaly.
Incidentally, this lack of convergence might in itself be interesting but then it's a global phenomenon and the prime example should perhaps be South-Eastern European countries like Bulgaria and Romania. They enjoy a much tighter level of integration and support from richer EU countries than Mexico does from the US and yet haven't really made any big jump in the last ten years…
While not the only reason, part of the reason is going to have to do with the drug related violence in Mexico. While homicide rates due to the drug war are on the decline, they are still quite high. This creates a cycle of decline as violence generally leads to poverty and poverty generally leads to violence.
Therefore it is unlikely, unless we fix the root of the problem that we will see Mexico develop in any meaningful way.
About the industrialization, @Relaxed's answer explains it nicely.
About Mexico's economy, there's a theory that states that the territory owned by a state is primordial. This theory is supported by many researchers in the field of geopolitics. This theory correlates the territory of a country with the rich-capital type of economy.
"The (US') network consists of six distinct river systems: the Missouri, Arkansas, Red, Ohio, Tennessee and, of course, the Mississippi. The unified nature of this system greatly enhances the region's usefulness and potential economic and political power. First, shipping goods via water is an order of magnitude cheaper than shipping them via land. The specific ratio varies greatly based on technological era and local topography, but in the petroleum age in the United States, the cost of transport via water is roughly 10 to 30 times cheaper than overland. This simple fact makes countries with robust maritime transport options extremely capital-rich when compared to countries limited to land-only options. This factor is the primary reason why the major economic powers of the past half-millennia have been Japan, Germany, France, the United Kingdom and the United States." https://www.stratfor.com/analysis/geopolitics-united-states-part-1-inevitable-empire
That being said, Mexico could not became too rich from the start.
After, is about the political style of a country. Following Machiavelli's theory, the first Americans came from Europe, from countries with strong democratic traditions, with solid institutions. The Mexicans had more authoritarian regimes in their past, that lead to almost no "middle class" and with a poor and with almost no rights "working class". The authoritarianism also leads often to corruption. Probably USA preferred working with less corrupt and less dangerous regimes. Or they did collaborate with corrupt and authoritarian regimes when they had a HIGH interest to do it (A lot of oil, geostrategic position, etc., etc.)
As a last thing, we can discuss also about the drug problem, that is plaguing Mexico and its citizens.