Then I packed up Moody’s clothes and Dark detectors, put them in the trunk with Moody, and set off for Hog- warts. I kept him alive, under the Imperius Curse. I wanted to be able to question him. To find out about his past, learn his habits, so that I could fool even Dumbledore. I also needed his hair to make the Polyjuice Potion.
He states that he kept Moody alive to question him so he is able to fool Dumbledore.
This line is unclear as to what it targets,
I also needed his hair to make the Polyjuice Potion.
You can read this line as saying, "he needed Moodys hair", "so he put his body in the trunk", OR you can read this line as," I needed Moody alive so he kept growing hair that i could use for the Polyjuice Potion".
Neither option specify that the Polyjuice Potion NEEDS a living victim for the potion to work. That is pure speculation on our part via the text.
Its important to note that Barty Crouch Jr. needed a supply of hair for an entire school year, of potentially drinking the Polyjuice Potion every hour of every day. So would you risk just shaving his head and killing him, what would happen if you ran out of hair? Hence keeping him alive, to continue to GROW hair would be important.