Was Louis XIV actually the son of an illiterate Spanish peasant?

No, but maybe.

His mother was Anne of Austria who was actually from Spain and a hottie famous for her delicate hands. His father, maybe, was the homosexual Louis XIII. Louis and Anne were forced into a political marriage when both were fourteen. In 1615, they had a proxy marriage (when two people are in different places but hold matching ceremonies) and were never much more intimate than that as Louis apparently refused to consummate the marriage for years.
The loving couple

It got so bad that in 1637 Anne was accused of spying for her brother, the king of Spain, during a war he waged against France. Thirteen angry months later, at the age of 37 and after 23 luckless years, the isolated Queen Ann produced an heir, the future Sun King, Louis XIV. French historians argue there was a specific stormy night in early 1638 during which Louis XII actually slept with his wife. Others speculate that her brother smuggled over a Spanish lover or baby and put one over on the French.

Another theory for Anne’s barren years is housed in Paris’ Cluny museum which boasts one of the world’s finer collections of medieval chastity belts.  Queen Anne’s very own belt consisted of hinged iron plates hanging off iron waist-straps which were cushioned on the inside with lace. On the front, Adam and Eve are etched in gold above the vaginal opening.[1] 
The queen's chastity belt

[1] “Chastity Belts”. NDA. Slideshow World/Robinson, John.   20/07/2011. http://www.sideshowworld.com/a/at/atsCB.html