This is variant of a traditional Christian proverb; ie: "Hate the sin, but love the sinner" in Sermons, Lectures, and Occasional Discourses (1828) Edward Irving, and similar expressions date to those of Augustine of Hippo: "Love the sinner and hate the sin." Gandhi did express approval of such sentiments in his An Autobiography (1927): "Hate the sin and not the sinner" is a precept which, though easy enough to understand, is rarely practiced, and that is why the poison of hatred spreads in the world.
More quotes by Mahatma Gandhi
"An unjust law is itself a species of violence. Arrest for its breach is more so."
Victory attained by violence is tantamount to a defeat, for it is momentary.
You may also like
Love looks not with the eyes, but with the mind,
And therefore is wing'd Cupid painted blind.
To fear love is to fear life, and those who fear life are already three parts dead.
Not for the body, but for the heart; companion and company are needed.
Love seldom haunts the breast where learning lies,
And Venus sets ere Mercury can rise.
Attribution
Quote text and notes from Wikiquote: Mahatma Gandhi (page history), available under CC BY-SA 4.0. Source quality and labels are our own summary of what Wikiquote records.