and I'm wondering if I will get shorter response times if I have
bought the domain in the same firm where I contract the hosting if
most of your potential visitors/customers are in Spain
As already said by Bybe it won't slow down your site, because domain DNS data are cached all over the WWW. Therefor most of your visitors' browsers will retrieve such data from the closer server, they won't need to ask Godaddy in US.
But, beware that if something happens to your server (downtime/crash) and the webhoster disappears (very common nowadays) or takes ages to solve the issue and you decide to move to another server, you will have to change the DNS entry at your domain. If your domain is not in Spain any change to its DNS will take much longer time to propagate to your Spain located visitors/customers compared to having the same domain in Spain.
or if search engines punish my site because of that.
No, they won't at all! It could be the opposite, if you buy domain wherever, but place the server in US West (or even farer i.e. Singapore), since it's far away from Spain latency would slow down a bit your site, and search engine might punish you for this.