The ‘why’ of this ws discussed before bit I can’t remember why it does it. Fairly sure you can’t stop it.
The two ways I address it are
Hide the back geometry before masking.
Or, once I’ve masked some, go to the side view and draw a rectangle round the bit I don’t want masked and invert to clear that bit.
Pbothnworkarounds I know.