Both Guarani and Spanish are spoken by most of the population of Paraguay, whereas in most other American countries they were either completely wiped out or became relatively irrelevant - how did it come to be that this relatively small country maintained the native language in equal par with Spanish? Did this correlate with better treatment of the natives as a whole?
Guarani actually isn't the only native language of Paraguay, rather it became a lingua franca after the region was forcibly politically 'united' after Spanish conquest.
This happened because Paraguay was probably the Spanish American colony with the lowest amount of European immigration, so Catholic missionaries found it easier to learn Guarani themselves, as it was already spoken by a significant portion of the population there, and teach it to those who didn't, than they did to teach everyone Spanish from scratch. In this way it evolved into a lingua franca widely spoken throughout the region, far more so than Spanish ever was.
After Paraguayan indepedence, the country adopted a rather unique type of nationalism different to the other former Spanish American colonies. While others mostly looked to replicate Europe as much as possible, José Gaspar Rodríguez de Francia, the first president/dictator of Paraguay, took about as much of an opposite stance as possible. He was so against Spanish influence and so adamant about making the country its own thing that he turned Paraguay into an isolationist inland country in which Guarani was promoted as the national language, Spanish/other European immigration was mostly illegal, and even made it illegal for people with Spanish lineage to marry other Spaniards in an attempt to 'breed out', so to speak, the landowning aristocracy.
This was reversed for many many decades after de Francia died; the aristocracy regained political power and banned/discouraged the use of Guarani. But by this point, most of the population already spoke the language as their first language, and the state didn't have anywhere near the resources needed to enforce this ban and teach everyone Spanish, so their attempts to repress it failed.
The Paraguayan elite continued trying to repress Guarani and instill the Spanish language and 'European values' in the population for more than a hundred years, but largely failed, even though Guarani was completely excluded from the formal education system until about the 1940s. After that, political parties from all across the spectrum began to adopt an idea of a unique 'Paraguayan identity' centered around pride in the Guarani language as part of their programs to attempt to appeal to the majority of lower and middle class people who spoke the language. This nationalist discourse became so popular so rapidly that the 'pro-European' ideology previously espoused by liberals in the country became politically unviable and even they were forced to accept that Paraguay was a bilingual country.
However, Guarani was (and still is) not offcially considered to be of truly equal status to Spanish. In the 1967 constitution for example, Paraguay was acknowledged to be bilingual, but Spanish is given a special status above it as the 'official language of government and business'. The populist rhetoric of the nationalists was just that. In practice, while tolerating Guarani, they still tried to stifle it being taught formally and tried to direct the education system more towards Spanish, at times even violently oppressing efforts to teach literacy in Guarani. This attitude has resulted in higher Spanish fluency, but it has failed to reduce the significance of Guarani.
So in reality, Guarani has been the 'true' national language of Paraguay for centuries, and today it's still the predominant language in the country, spoken day to day by most people, though most are also proficient in Spanish as it's required for official purposes and taught widely in schools.
When it comes to preferred language, as in language spoken at home, the 2002 census showed that 60% preferred Guarani and only 35% preferred Spanish, making it clear that Spanish only has equal status on paper.
Only through elite social engineering has Spanish made headway. Aside from the Spanish descended elites, Paraguay was practically a monolingual country until the early 20th century - most people only spoke Guarani, despite all of the efforts to change this, and today most still speak Guarani and only speak Spanish sometimes because they have to.
Source: Governance and the Revitalization of the Guaraní Language in Paraguay, RA Nickson.