A little-known division of the Justice Department is using the nation’s bankruptcy courts to impose the federal marijuana ban in states that have legalized pot, preventing people who work in the cannabis industry from using the bankruptcy system to save their home or business.

Claude and Kerri Hayes were kicked out of bankruptcy court in 2017 after the couple filed to stop a mortgage company from foreclosing on their Mt. Vernon, Wash., home. A representative of the U.S. Trustee Program, the DOJ arm that monitors federal bankruptcy...