The coast is the ultimate goal of the journey for the Man and his son, where the road is supposed to lead them. It's not completely clear why getting to the coast is of such paramount importance literally, except the Man briefly mentions following the coast south to try and find others like them.
I would say the ocean represents beauty and hope to both of them. The last beautiful thing the Man can remember, perhaps, and something the boy has never seen. To reach it is to make it out of the cannibalistic nightmare of tragedy and holocaust they have survived thus far.
It could also be that the coast is simply a destination, any destination that is not here, not now, and therefore must be better. McCarthy pretty perfectly illustrates the death of hope when the ocean is not beautiful at all, and the Man ultimately dies there.