According to this classification, there are three main reasons that make Spain a top destination: personal safety, the weather, and quality of life.
HSBC base the ranking on 15 criteria grouped into three categories: Living, Aspiring, & Little Expats (kids). You can see the how Spain performs according to the criteria (see criteria)