The concern relates to potential ignition issues in a confined space in the presence of hydrogen gas (from lead acid batteries under charge) or, in the case of an inboard gas engine, gas vapors. If there's any chance of a spark, either one could result in a serious ignition or explosion. That's one reason that you'll often see "ignition protected" components such as a starter motor in the engine compartment of a gas boat. If you use propane on board (e.g. for a BBQ), that represents a very real potential explosion issue (aka a bomb).
Note: Propane finds the lowest level in a boat and cannot be removed by exhausting/venting. So, it just sits there waiting for an ignition source to go boom!
I have built-in on-board battery chargers on gas boats and I also use battery minders in several gas watercraft, most of which have outboard engines. I also have several battery chargers and an inverter in the engine room of a diesel boat, but this does not present the same kind of ignition issue that an inboard gas engine presents.
Bottom line, if you hard wire the charger in the boat, the risks are diminished. You have to make the ultimate decision, but I'd install the charger.