If the right type of masking tape is used for a job and is applied correctly and then removed carefully, it should not peel off the paint.
One of the most common reasons for masking tape peeling off paint when it is removed is that the underlying layer was not fully bonded to the surface – for example, if the paint was applied to damp plaster.
If the tape is left in place for too long, the adhesive may degrade and cause it to stick more tightly to the underlying wall, in which case it will be more likely to peel paint away.