I notice you already have this question for the Holocaust but haven't found it for the Spanish expulsion. I understand that many great people gave reasons for it, like the seder hadoros, tsror hamor and ohr hachaim of yosef yaavets linked below. Perhaps you know of many others. Why did the Jewish people deserve the Expulsion?
We are told many times throughout the Torah and Tanach that we will be spread to the four corners of the Earth among the nations and that....
All are troubles throughout history are pointed to from this pasuk... We, as a nation, will never have long lasting peace and security living among the nations.... this is all to remind us that we don't belong there and it is not our destiny to remain in galus.