Sometimes when people, all people but especially toddlers, get very upset they really do have trouble accessing all those communication skills they have when they're calm. So much goes into coping with what life throws at us besides just having a good vocabulary. We have to be able to manage our emotions, to be flexible, to see things from another perspective, to problem-solve, to identify our emotions in order to communicate them, etc. I find that it helps a lot to focus on modeling those skills, on "translating" for my very little ones (they hit, I say "oh, you're angry/upset/frustrated" or "you want that toy"), reminding them to be gentle, and teaching skills (practice identifying emotions, practice calming down so we can solve the problem with our words instead of hitting, lots of discussion about what others might feel/think, practice coming up with ideas about how to solve problems, etc.-all this stuff we do in daily life even with little ones). It does take time to learn, though.
She probably does care very much that she has disappointed you, and though she "knows" that she shouldn't hit, she's really still very young and it's still hard for her to control her impulses. I've found it helpful to identify which situations/triggers are likely to lead to hitting, and to either avoid those situations or step in before it reaches the point of hitting. It may seem like it comes out of the blue, but IME it's usually actually very predictable.
I think what she's doing is very normal, and that you are teaching her. She is learning, it just takes time. Keep modeling, keep helping her learn, and this will pass.