I do not like my behavior.
Parenting is difficult at every stage for somewhat different reasons. Children aren't miniature adults, especially at your child's age. They don't think or process like adults; they don't have a long period of time to learn 'the consequences' of simple behaviors like adults. Even some adults haven't learned yet to accept the consequences of their own actions (ever see anyone argue with a speeding ticket?)
Your particular behavior shows that rational thinking is much more comfortable to you than empathy. For anyone in any kind of pain, however, the opposite is true. They need empathy first, and rational thinking later - much later.
You might not be comfortable with empathy first, but you can choose to change your behavior. The more you practice it, the more comfortable and happy you will be using it. Positive responses from those in pain will be rewarding, as opposed to the cold shoulder you now experience.
How do I be more sympathetic towards my children's pain?
Drop the "I" from your response.
If you're tempted to use "I", it should only be followed by "...am so sorry you're hurting". Stop there. This isn't about you, how you feel about what happened (powerless), about teaching the laws of gravity or Murphy's law. It's about your child's (or, indeed, anyone's) pain, physical or emotional. So, number 1 for you is no "I" (or "me") statements.
Don't blame the victim for their pain.
The opposite of comfort to someone in pain is the statement, "If you had listened to me, you wouldn't be hurting right now." It adds an element of insult to injury, even if it's true. Even if it's true, it is not an empathetic response. Pain requests empathy, not blame.
Before saying a word, imagine your child's pain were your own.
It's hard to see your child in pain, and the number of times it is a direct result of not listening to you are and will be innumerable. It's less comfortable to experience the child's pain than to rationalize it. But live with it. Being a parent (or a person in relationship to anyone else) means living with the hurt of others.
If you do that, a response to the above situation might look more like, "Ouch/Oh my goodness! Here, let me see. [Honey/Sweetie/whatever the affectionate nick-name], do you want some ice on that? (In other words, I feel it with you. How can I help?)
Practice, practice, practice.
This will not be easy for you, nor will it be comfortable. But as a parent it's part of your job to raise children who feel valued. You'll make mistakes; if you catch yourself in one, start over. "I'm sorry, let me start again..." sounds trite, but it's not. It allows for practice even when you flub up. It acknowledges that your first response was the wrong one. It helps.
Pick your teachable moments, and separate them from the event by at least 30 sentences.
Yes, that's a crazy, random number. But it means you'll not have insulted the child for a while, and will keep you in an empathetic mode. When the child has first experienced a significant degree of empathy from you, then they can hear the life lesson. It might even give you time to realize that the life lesson isn't what you think it is.
Read about how to develop empathy.
This is just a start. Reading about the hows and whys will help you understand your response and how it differs from the ideal.
There's a fascinating case of a neuroscientist doing a study an imaging study of sociopaths (people unable to feel empathy) who, while reading MRIs of the groups, realized that his own MRI revealed defects indicating he was a sociopath. He set about speaking to his family and colleagues about his actions, etc. and realized that yes, he was a high-functioning sociopath. Buy he studied empathic responses and became a better husband, father, and human being. He still was not naturally empathetic, but his relationships improved.