The two parts of Don Quixote were not written in quite the same country: when the first part was written it was legal for a Moor to live in Spain; by the time the second part was written it was not. Chronic tension between the two ethnic groups, worsened by economic pressure, culminated in a series of royal decrees ordering that all remaining 'moriscos' be banished permanently. The process was systematically carried out between 1609 and 1614, the exiles permitted to keep only what possessions they could carry with them.
The change is reflected in the book: while in Part I a morisco is hired to translate Cide Hamete's manuscript, and the captive Ruy Pérez de Viedma is able to return home with the beautiful Algerian Zoraida practically as his fiancée, here Sancho's friend Riconte must sneak back into his homeland in disguise. Cervantes allows him to muse poignantly on the grief of being treated as foreign in the land of one's birth, and even contrives a happy ending in which he reclaims the property he hid from the government, and is reunited with his daughter. However, this is accompanied by his repeated humble ackowledgments of the general evils of his race, and praise for the wisdom of the King's decision.
Hearing a subterranean Sancho's voice emerge from a pothole Quixote believes him to be dead and trapped in purgatory, promising to pay any amount to release his soul. In the late Middle-Ages the sale of holy indulgence by fraudlent 'pardoners' was a widespread practice, based on a wilful misintrerpretation of the Catholic Church's doctrine allowing exemption from punishment or penance for one's sins.
The practice was nevertheless 'indulged' itself as a means of financing holy works by some within the Church, such as Dominican preacher Johann Tetzel to whom was attributed the catchy jingle "As soon as a coin in the coffer rings, a soul from purgatory springs". Dispute over this issue, and similar abuses of scriptural authority, was part of the impetus for the Protestant Reformation, as stated in Martin Luther's Ninety-Five Theses of 1517.
Duelling was prohibited under the harshest penalties the Church could enforce following the Council of Trent (which convened between 1545-1563). By allowing a public battle to take place within his territory the Duke risks losing it forever, as well as being excommunicated along with both combatants and all spectators present. The combat is averted at the last minute, although this is against the wishes of the Duke himself whose actions remain highly questionable.
Online copy of the Council of Trent Session Twenty-Five (relevant passage: Chapter XIX of the Eighth Decree)