Crews aboard Hanjin Shipping Co. vessels docked at American ports are being barred by U.S. immigration officials from coming ashore, a decision labor groups say goes against international seafarers’ conventions.

Sailors on several Hanjin ships were denied shore leave out of concern they might not return to their ships, U.S. Customs and Border Protection said in a statement. The concerns arise after the shipowner filed for bankruptcy protection late last month. The company’s fleet sat idle at sea for weeks after filings in...