Alonso Quijano was obsessed with novels of chivalry. His favorite was Amdís de Gaula, a hero who lives adventures among princesses and enchanted castles.
One of the characters in this novel is named Don Quixote. Alonso considers it the perfect name for an honorable gentleman, so he calls himself that.