Royals have many names because they are named after so many ancestors.
I believe that the parents wanted to honor or pay tribute to past royals.
The reigning Prince of Liechtenstein is Johannes Adam Ferdinand Alois Josef Maria Marko d'Aviano Pius.
Infante Pedro Carlos of Spain and Portugal (1786-1812) is Infante Pedro Carlos Antonio Rafael Jose Javier Francisco Juan Nepomucenco Tomas de Villanueva Marcos Marcelino Vicente Ferrer Raymundo. His grandfathers were King Carlos III of Spain and King Pedro III of Portugal.