the legal argument that the government and courts have used for this is that safety inspections are not investigative, but administrative. administrative functions never violate the 4th Amendment because there is no suspected criminality involved.
Its both a safety inspection and a criminal investigation, because its a crime to not have certain equipment on the boat. Additionally I don't give the government extra authority simply because they are trying to protect me from myself v. enforcing laws.