Just to clarify- you can absolutely marry whilst visiting on ESTA. It confers no immigration benefit as such, and you will have to leave before the allotted 90 days.
If you come to think you might want to stay, it is illegal to enter with the intent to try to adjust status. You would need to return home to wait out the visa process.
In any event, if you eventually do want to live in the US permanently, the CR-1 route is the way to go for a green card, by far.