Paul,
Any number of plausible reasons-drug or smuggling interdiction law enforcement, support for an American cruise ship SOS, a SAR mission, logistics, aids to navigation, environmental protection and military readiness, training flight, etc, etc. Did you get the registration number? Date and time of the photo? Heading of aircraft?
Castaway Cay is easy range from a south Florida USCG Air Station. It looks like a Sikorsky HH-60J JAYHAWK. USCG Clearwater operates them. The HH-60J is adapted for a medium range recovery role and has about a 700 statute mile range, 345 out and 345 back while carrying an additional load such as six survivors in addition to the four man crew.