First off, she was an addict. I mean, keeping yourself alive unnaturally for 400 years is bound to mess anyone up to some extent. But then taking away that thing you've come to depend on for so long, which you'll die without? Well, I can't say what she did was understandable exactly, but it's certainly not as simple as "I want all the power!!!"
Next, let's look at her options regarding Rapunzel.
1. Cut off some of Rapunzel's hair and use that. This is what she tried to do first; it's simple and it doesn't hurt anyone. Unfortunately, it didn't work.
2. Raise Rapunzel as her own daughter. Obviously she was too vain and manipulative to do a great job at this, but she did seem to care for her as much as she could care for anyone.
3. Keep Rapunzel completely locked up and never allow her even the smallest pleasure. This was what she felt forced to do at the end, though she clearly didn't want to. It was Rapunzel's promise that they could be a family again, like old times, that got her to grant her final request to heal Flynn.
She really didn't want to hurt Rapunzel, so she only did what she felt she had to. Plus, she provided Rapunzel with tons of books, paints, games, pretty much everything she could ever want (besides freedom), made her favorite food when she was sad, and was even willing to go on a 3 day journey to bring Rapunzel back some paint she wanted.
As for the love the two of them felt for each other, it could be explained as combination Stockholm and Lima Syndrome. But it was there regardless. Which actually made Mother Gothel even scarier; that moment where she looks down at Rapunzel all chained up and curls her lip was just...chilling.
Toward the end, when she's explaining to Rapunzel how cruel the world is, she really seems to mean it. Either she hates herself for what she's doing or she herself was badly hurt at some point, which has continued to affect her. Either way, it's an interesting character note.
All in all, she's a great example of a "grey" villain. And also teaches kids a very important lesson that they don't hear often: sometimes the people you should be the most wary of are the ones you trust the most. It's one thing to learn that strangers could hurt you, but quite another to learn that someone you love may not have your best interests at heart.
Plus, when she says "I just listened for the sound of complete and utter betrayal, and followed that" she sounds just like GLaDOS. Tell me that's not awesome.