One of the principle advantages of building a wind farm offshore, is that no land is used for the construction. So there is no requirement to compulsorily purchase land for the project.
Another advantage, is that a wind farm sited offshore is free from geological features, that can obstruct airflows at the site.
On the downside, the construction costs are higher, than they would be for a land site, material constraints are tighter, also the infrastructure and maintenance costs are higher.