Netflix watchers will know the palace from the tv-series 'Gran Hotel'.
Construction of the palace was initiated in 1908 by the local government of Santander for the purpose of providing a seasonal residence for the royal family of Spain. Funding was provided via popular subscription of the local populace. 
The design and construction of the palace were overseen by architects Javier González de Riancho and Gonzalo Bringas Vega, with construction completed in 1912. King Alfonso XIII and his family first arrived at the Palacio de la Magdalena on August 4, 1913, and returned annually to summer at the palace through 1930. The royal family used the palace as a base for numerous recreational and sporting activities, and the king sometimes also held government meetings at the property. The annual trips ended with the proclamation of the Second Spanish Republic in 1931. 
Beginning in 1932, the palace was used to host summer courses through the Menéndez Pelayo International University. In 1977 Don Juan de Borbon sold the palace and the peninsula back to the city of Santander, which had previously given it as a gift to the royal family, for 150 million pesetas.
One of my favorite Netflix series is the Gran Hotel not knowing at the time of watching that the hotel was the former royal palace Magdalena. It makes me want to rewatch portions of the show now that I've discovered this thread.