The rational justification is that seaside has often wind from the sea which bring cleaner air. There are no car exhaust, no power plant emissions, no factories, no dust in the sea.
Air quality in any coastal city in Poland is much much better than in Warsaw/Krakow/Wrocław which are quite far away from the Baltic sea.