Lead especially scrap has impurities in it and on it. Dirt,debris, old alloy metals etc.
These impurities can clog lead pot spouts and make for incomplete castings among other things.
When it is melted only some of those impurities come out from the melting process alone.
Fluxing causes most of the rest if not all of those impurities to separate and being lighter than lead float to the top where they can be skimmed off.