Getting blood squirting out is simple, you nicked a vein on the way in. Sometimes I get a stream shooting a few inches out. pretty cool when you think think about it. As long as it wasn't you!
As for the pain... After 7-8 years of sticking a needle into my thigh, this 'Scientific Method' engineer cannot understand why this is so. I have no clue why aside from now and then you nick a nerve, just like the vein example above. I can feel the needle tip going through the fat, hitting one muscle, some pain, going deeper, hitting another muscle, still pain (the first one most likely).
Luck of the draw. If it happened in a doc's office you'll complain about the PA doing it.
If you do thigh shots like I do, DO NOT tense you leg up. Make sure you hit the right muscle groups. And....
Do you know about the 'Z' Track? Essentially sliding the top of layer of skin off to the side before you inject. When you let go after after injecting and withdrawing (DO NOT Before, it will hurt), that layer of fat and skin will most seal off the tunnel to the mother lode of the "Elixir of Life". Oh.. Also whatever blood for the most part that may squirt out