There are, in fact, plenty of places in Spain that are cheap and located near the sea.
These places are Malaga, Alicante, Tarragona, Cadiz, and Tenerife.
Living in these locations provides you with access to many attractions and a plethora of beaches.