Building closer to shore can bring other problems like a corrosive salt filled atmosphere and higher hurricane and flood dangers.
Im not saying it can't be done, but building near the ocean has its own set of drawbacks and costs.