Why did Spain establish these colonies?

You may wish to specify which colonies you are referring to. In general, though, Spain founded colonies in order to extract resources from the ground (especially gold), convert the populations to Christianity, and achieve renown through the act of conquest.