The residency-by-investment program meant to stimulate the economy was so popular that Spain had to shut it down.