Hi yckin,
It's a sort of, watery salute. To greet the ship when it enters port.
But of course, they have the water cannons to be able to fight fires, in the first place. Since tugs are always about doing their jobs, they could often be the first on the scene of a fire, and fight it.
But with the cruise ships and such, it's the salute, and the spectacle, that they're used for.
Regards,
Fred