Both of the above are reasonable choices and you can add Cocoa Beach near the space centre into the list.
For a day trip,with it taking at least 3 hours travelling, I prefer to spend a day at a waterpark. If I was looking to take some beachtime I'd book a motel on the coast and make it a 2/3 day break. IMHO there's nothing worse than facing a 2 hour drive when you're hot, tired and sun burnt.
The Atlantic coast ( Daytona and Cocoa) get "real" waves and surf but the seawater is a more comfortable temperature for longer on the Gulf coast ( St Pete's/Clearwater). For June,July August I'd go to the Atlantic side, most of the rest of the year I'd more likely choose the western coast.