I was hunting and saw a whitetail deer (Indiana) that I normally would not have shot but it was clearly an injured/sick animal so I put it out of its misery.

Upon examining the body I saw something I was simply not prepared for. The animal had a hole on each side of its body from a previous injury (hunter's shot most likely, entrance and exit wound). Each hole was covered in maggots. Lots of hair was gone and falling out in clumps around the wounds. The bare spots where hair was missing was black when it should have been brown. Where there was still hair around the bare spots the hair was moving from the maggots crawling under and on the skin. After flipping the animal over a pile of maggots was left on the ground. They were pouring out of the wound. The animal smelled like rotten carcass when it was literally walking around just minutes earlier. A person coming across the dead animal would have thought it had been dead for days.

My question is when did this animal recieve the injury that led to the maggot infestion?

Perhaps I am wrong but I'm under the impression maggots don't eat live flesh. If I am correct on that then the wound had to get infected, and start rotting before the eggs were laid for the maggots.

Also, are there other examples of living animals having maggots eating them up?

for this you would need to ask some forensic guy, who could tell exactly the time since infection. As I understood, the animal was shot throughout the body? Anyway the shot was infected and the muscle in around got dead. Thus it could be eaten by worms/maggots (I don't know the English names either).

It is possible that this deer was shot by either a very high power compound bow with a bear hunting arrow. That would go straight through the deer because it is so powerful. Otherwise, it may have been shot with a rifle of some kind which also packs enough punch to go straight through. In both cases, damage could be considerable that infected would cause necrosis of tissue which would entice the maggots. The injury might have also severed blood supply to the region which would have caused necrosis as well. You are correct that maggots do not live on live flesh, only dead tissue which can be attached to live tissue.

My other instinct is that this animal could have some kind of disease that was causing tissue necrosis. There are a couple of diseases that I can think of that occur in New Jersey that crop up from time to time. I recommend that you call your park and wildlife office or the check station and let them know what you found. If it is an infectious disease, it is best that they know about it so they can go check it or watch for more. In the state of NJ, you have to check in all your kills to be checked by a certified inspector for diseases (it prevents the contagion from making it into the human population).