Mexican culture seems to put a great deal of emphasis on politeness, and I'm wondering if this is something that has come from the influence of Spanish culture, or if it developed independently as Mexican culture grew into its own.
I can't really answer your question regarding politeness, as it's difficult to trace such a rather abstract cultural tradition from colonial times until today. Very generally, I would highlight here that Mexican culture did not develop independently, but through a complex (and often violent) mixing of Spanish/European with pre-colonial indigenous cultures.
I'd definitely agree with you on the politeness in modern-day Mexico though, which may very well be connected to indigenous traditions in various regions. For example I know that for the pre-colonial Nahua (from central Mexico), respect and politeness played a very important role in both their public and private lives. We can see this in the polite forms of address used in dialogues between different rulers and nobles. These included the reverential form "-tzin", and a tradition of reversing a noble's age to show reverence (misinterpreted by the Spanish). On a less political level, as Lockhart (1992) and others have shown respect for one's elders was of major importance in Mesoamerican societies, and the elder wise men (or "tlamatinime") had a central role as transmitters of history and upholders of faith throughout Mesoamerica. Usually grandparents would live together with their children and grandchildren, and were highly respected, as can be seen in how they were addressed by their descendants. This respect carried over into colonial times, where "wise old men" are often mentioned as sources by native authors in order to bolster their authority before colonial courts.
While politeness was of course a feature of Iberian cultures as well, e.g. at the early modern Spanish court, i would argue that at the everyday or family level, politeness might have played an even more important role for the Nahua of pre-colonial and colonial Mexico.
In case you're interested more generally in those cultural mixing processes I mentioned above, you might find this answer I wrote interesting. Especially the 3rd part looks at some ways in which Aztec culture was incorporated into Mexican national culture in the 20th century.