I watched the 1943 movie "Crash Dive" the other day. This tradition was featured when the US sub "USS Corsair" returned to base after one of its successful patrols (it sank a Q-boat). The question was asked in the movie what the broom signified, and "clean sweep" was the response.
Not an overly realistic film BTW (submarine crewmen doubling as Commandos???) - indeed it's up there with U-571 and Pearl Harbour for American flag waving, but considering it
was released in 1943, it's totally forgiven.

Watch it if you get a chance!