Social media sites have called for fresh protests in Casablanca and Rabat next week after baton-wielding police dispersed demonstrations on Friday.
Daniel Galvan Vina, said to be in his 60s, was pardoned by King Mohammed VI and freed on Tuesday from jail in Kenitra, north of the capital.
He had been sentenced in September 2011 to 30 years in prison.
Galvan was among 48 Spanish prisoners released in response to a request from Spanish King Juan Carlos, who visited Morocco in mid-July, the justice
But royal palace said in a statement carried on Morocco's official MAP news agency that the king had been unaware of the nature of Galvan's crimes and had ordered a probe into his release.
The investigation should "determine the responsibilities and the failures that led to this regrettable release," the statement said.
"The king was never informed -- in any way or at any time -- of the seriousness of the abject crimes of which the person concerned was convicted," the palace added.
"It is clear that the sovereign would never have consented" to his release, given the "monstrous crimes" committed, the statement concluded.
Galvan is thought to have already left the country.
The incident has sparked outrage in the north African country, which has seen several high-profile paedophile arrests in recent months.
On Friday night, baton-wielding police dispersed several thousand people who tried to protest in front of the parliament in Rabat.
Dozens were injured, including reporters and news photographers, and some had to be hospitalised.
Others were held outside the Moroccan embassy in Paris on Saturday and in Kenitra, where the man had been held.
Police also broke up demonstrations in Tanger and Tetouan.