Latin America is an important supplier of raw materials and natural resources, existing and emerging economic powers are currently in a race to exploit these resources. China has been looking to replicate its success in Africa elsewhere. There is certainly no lack of demand for mineral resources in burgeoning Chinese industries.
I don't think this is motivated by a desire to be closer to the US. Of course, the influence China gains through hefty investments into these countries will be there. But why shouldn't it? This isn't vulture capitalism, the economic activity this generates will not only diversify Latin American economies but help prop up economic growth, development and standard of living. If the US wants to maintain economic dominance in the region, they are free to compete, and benefit Latin America in the process.