Yes you can have your summer house in Spain, not a problem.
You can either stay there <183 days a year or you can rent it out. If you rent it out, you will declare the rent and you will pay I believe 20% taxes over this as a non resident.
Spanish tax office does check utilitiy bills on a regular base, and other signs that you are spending more then 183 days in Spain. So if someone is in your house >183 and you did not declare rent, then they will claim you were there more then 183 days and you have a very diffecult case.