I think originally screaming was a plot device used to instill fear in people watching the movie. After all, if you saw a dead body and just whistled Dixie, no one in the theater would care at all.
I think that the underlying reaction of screaming (to answer your question) is to let off stress. You see this corpse in front of you, and you are tense, not knowing what is going on. Screaming releases your tenseness by expelling air from your longs, and gets you breathing again. The faster you breathe, the more your blood flows, and your instincts increase. It gets the body ready for a ’fight or flight’ activity decision.
So in a sense, screaming makes sense, since it girds the body to be able to better deal with additional threats.
But this is only for a surprise discovery of a body, like in the woods.
If you go into a hospital, you see people dying all the time. No screaming there. Why? Because in a hospital, death comes as no surprise - it is expected. So .. no surprise, no screams...