Looking up the testing on Wikipedia, some of the tests were dropped from planes or exploded from a barge, so why not do that in the Pacific and then they wouldn't have had to relocate the people who lived there? What was the advantages of doing the testing on a tiny atoll?
The reason they wanted to be on or near land most of the time (but not always!) is because of ease of deployment and measurement. They weren't just blowing them up to see things go boom (most of the time), they were doing scientific experiments that generally required them to know exactly where the bomb was going to go off to give good data. (Yeah, they dropped a few out of planes, but even those were often off-target a lot of the time and screwed up data collection.) The ease of having it on an island is that they could have all of their people and equipment nearby. Did they trade their convenience and ease of data collection for the contamination of the islands and relocation of the people? In retrospect, yes. At the time they dramatically underestimated (perhaps too-conveniently) the contamination issue, and did not think it would be a big deal.
They did some tests far away from the islands, but these tended to be different sorts of tests (like high-altitude tests) that didn't have the same kinds of logistics issues (they had their own logistics issues).
In terms of where to test, they wanted places that were fairly isolated, but still accessible. In fact, the islands were still pretty difficult to access, especially when you take the weather into account (at least one scientist died while taking helicopter transportation between various atolls — it was not ideal conditions for scientific work!). This is why they eventually shifted more and more of their testing to the Nevada Test Site (much more accessible, but also extremely contaminating of Americans).