Most fairy tales follow the same path. The hero or heroine begins the story in poor circumstances, either externally(eg poor and starving), or internally (longing for that thing that will bring them fulfillment). They then enter on a path of trials, sometimes this is thrust upon them, other times they choose it willingly, as in many trickster tales. By meeting these trials with courage, fortitude, cunning, patience and gallantry, the hero/heroine reaches a new dimension in their life, where they reap both external rewards - riches, princesses, castles - and internal rewards - they have become a 'whole" or 'complete" person. This doesn't mean a "better" or "perfect" person, it means they have fulfilled their own personal destiny and found their true self.
Seen in this light , the evil stepmother or witch is a necessary part of the hero/heroine's path. They are the catalyst for change, without which the hero/heroine would stay a poor child, a simple tailor, a stuck-up princess. If the wicked stepmother had allowed Cinderella to go to the ball with her daughters, dressed the same as them, would the prince have noticed her? If Hansel and Gretel had not been dumped in the woods by their stepmother (or in some versions by both parents), they would not have encountered the witch's edible house and overcome her, thereby maturing and earning rewards.