Let's analyze the paragraph, shall we? It'd be easier in Spanish since I'm a native Spanish speaker, but I'll try my best.
Si yo estuviera presa, me gustaría que dos de mis muñecas, la Toti y la Mónica, fueran también presas políticas. Porque a mí me gusta dormirme abrazada por lo menos a la Toti. A la Mónica no tanto, porque es muy gruñona.
The girl is thinking what it would be like to be a prisoner (most probably because her father is a prisoner and she was thinking about it, but I haven't read this book) and, being a little girl, she would like to bring her two dolls with her. The writer uses this to state that the girl somewhat imagines (or simply usually plays that way with the dolls) that the doll called Monica is a moaner.
Yo nunca le pego, sobre todo para darle ese buen ejemplo a Graciela. Ella me ha pegado pocas veces, pero cuando lo hace yo quisiera tener muchísima libertad. Cuando me pega o me rezonga yo le digo Ella, porque a ella no le gusta que la llame así.
Now, given that the doll Monica is a moaner, in a childish way, the girl, accustomed to being scolded or beaten up (I don't know if this word is "too much" in English, basically I'm referring to physical punishment of any level) when she is wrong, she concludes that the doll should be scolded too. That's why she says Yo nunca le pego, that presents that childish argument (to be scolded or hit) and at the same time is like a pun, an insinuation referring to her mother, which the writer expands in the next lines explaining that the mother doesn't hit her many times and stating that, when that happens, the girl calls her mother Ella.
Obviously, a child doesn't like being scolded or hit, even when she knows she did something wrong, so the girl gets upset with her mother when she hits her and somewhat resents her for that.
You can see the resentment in the pun/insinuation, like saying: see mom, Monica is a moaner and I don't hit her, why do you hit me?
You can see how the girl gets upset in that she calls her mother Ella: Ella is a cold pronoun, a general word that a little girl wouldn't use with her mother. A little girl use "mom" (as in my previous example), "mother", or whatever other word that expresses love, not a cold pronoun. That's why the mother doesn't like it, and that's why the girl achieves what she wants: her mother made her upset, she made her mother upset, like a little, naive revenge.
It's really a childish thing to do, but that's what she is, a child.
The rest of the paragraph is about the same thing, and finally:
A Graciela tampoco le gusta demasiado que yo la llame Graciela, pero yo la llamo así porque es un nombre lindo. Sólo cuando la quiero muchísimo, cuando la adoro y la beso y la estrujo y ella me dice ay chiquilina no me estrujes así, entonces sí la llamo mamá o mami, y Graciela se conmueve y se pone muy tiernita y me acaricia el pelo, y eso no sería así ni sería tan bueno si yo le dijera mamá o mami por cualquier pavada.
Seeing that the girl seeks her mother's love on other occasions, too, the writer states (basically reminds the reader) that the child is not evil, she's only a child who gets carried away by her feelings, like any other.
The fact that alunada means in bad mood, is only a way to clarify that the child is simply upset, which connects with that fact of the scolding and so on.
The whole paragraph seems to me a really tender and beautiful way of describing some of the little girl's feelings about her father imprisonment, and how she normalizes and accepts those feelings about the whole imprisonment thing — that would be a really hard and bad thing to happen to a girl that age.
Edit: Just to clarify one thing, since OP commented it.
@Ramon Melo: Reading your last comment, I'm thinking that you are seeing the girl being hit hard as mistreatment. If that's not the case I apologize, but anyway it's good to clarify it in the same answer.
I don't think the writer wanted to express a mistreatment per se, but just an old-fashioned way of educating; a small slap or spank.
Take in mind what I said originally in the answer:
...beaten up (I don't know if this word is "too much" in English, basically I'm referring to physical punishment of any level)...
I said it because there is nothing in the paragraph that suggests serious mistreatment or that the mother hit the girl really hard, without reason or often.
Note this phrase:
Ella me ha pegado pocas veces, pero cuando lo hace yo quisiera tener muchísima libertad.
This states that it's a rare thing to happen, and reading the whole paragraph, the girl doesn't have the attitude of a mistreated child, she just doesn't like it, which is obvious even when it happens in rare occasions.
I should read the rest of the book to be sure, but reading only this paragraph I just imagine the girl having a tantrum from time to time, because she is a little rebellious (alunada) and her mother has to spank her a little because she doesn't even listen to her anymore.
I'm not saying it's right or wrong, just what I read in the paragraph, but I'd feel more sad for her father being imprisoned ;)