As far as I understand it, they went there primarily because their then manager Alan Williams (who sadly died recently) had developed a good working relationship with Bruno Koschmider who ran a few of the clubs over there. Hamburg was a large and wealthy city, but quite why they wanted British/Liverpool bands rather than any other I'm not sure of.
Williams had already arranged for Derry and the Seniors to play in Hamburg but was asked for another band. He wanted to send Rory Storm and the Hurricanes but they were committed elsewhere, so asked the Beatles instead. They asked Pete Best to go with them as they previously had no permanent drummer. Ringo hadn't joined the band at that date, but he was a member of Rory Storm and the Hurricanes, the other band Williams considered.
As to what appealed to the Beatles, probably the regular income and adventure of playing abroad, plus the experience that they could brag about and use as leverage to get future gigs back home.