Spain rules in favor of wrongfully imprisoned Moroccan