The Spanish one wasn't a lunatic asylum though. This is the background:
In the early 20th century, tuberculosis and leprosy were washing through the municipality of Murcia in Spain. Mortality rates were skyrocketing and a decision to quarantine the sick was quickly adopted.
In 1913, construction began on a sanitarium outside of town. The first floor was finished in 1917, but the entire complex was not complete until 1934, because patients who were well enough were tasked with completing construction during the warm summer months.
So despite having leprosy or TB they had to work to build the hospital!