Easy 10
Brain dead MUG SHEEP
They could stop the encroachment easily, by handing out bookings for it. Technically (for a player on the defending side) its the same offence as charging out of the wall before someone has taken a direct free kick. If you did that, you'd get booked more often than not.
I think there's an element of "oh well, no harm done" if the penalty is scored despite a herd of players charging in before its been hit. Its only if its saved and stays in play that referees seem to think it needs to be a factor.
Obviously if a defending player encroaches and the penalty is scored then it stands, but I agree, the ref should book them for encroachment regardless, as they were seeking to gain an advantage. If an attacking player encroaches, then order a retake (if it was scored) and book him as well.