Upvote:5
The most ubiquitous kind of place that sells stamps in Spain is tobacconists (estancos): in addition to selling cigarettes, most of them sell other regulated products such as stamps. Look for a sign that says “tabacos” (they often sell stamps even if there is no visible indication on the outside).
The map of Barcelona Sants (linked from the [ADIF station information page](Station information) lists a tobacconist (48 Articulos de fumador) on the street level on Plaça Països Catalans (in front of the station).
Google Maps doesn't know about this shop, but it also doesn't know one near Plaça Espanya which I know for a fact exists, and I would be extremely surprised if a major station lacked a tobacconist.
There is probably a yellow post box in the station as well. The tobacconist or the tourist information center should know.