It seems as if war/death/etc is just as common in the Matrix as it is in real life outside of the movie. When someone dies in the Matrix, they die in their pod, do they not? = Loss of a battery. That is a whole lot of wasted batteries. Why do the machines allow a world with so much death?
People wear out
Bodies are bodies; they decline after a certain age and eventually fail for some reason or another. The machines can't change that, and given humans' relatively fecund nature, they have no driving reason to.
Maybe being sealed into a support coffin slightly lowers life expectancy. Maybe is increases it. But the humans are going to die eventually no matter what.
To run with the battery analogy, batteries wear out. After some number of recharges, their ability to hold a charge gets less, and your four-year-old cell phone has half the battery life that it had when new. Time to recycle!
People would notice, and be bothered by, the lack of death
The architect describes the Paradise Matrix:
[it] simulated a perfect world with no suffering to try to pacify their minds, but the human minds did not accept this version. Many of those connected died, and a Nightmare Matrix was designed in its place that tried to correct its flaws.
Accordingly, even if there was no need for War, the Nightmare Matrix that we see must have War, and Famine, and Conquest, and especially Death. Humans would notice. Humans would be uneasy. Humans would fail.
Men... Men are weak.
The first matrix did not allow that.
First quote is from Smith, second from Architect.
Did you know that the first Matrix was designed to be a perfect human world where none suffered, where everyone would be happy? It was a disaster. No one would accept the program. Entire crops were lost. Some believed that we lacked the programming language to describe your "perfect world". But I believe that, as a species, human beings define their reality through misery and suffering. So the perfect world was a dream that your primitive cerebrum kept trying to wake up from.
The first Matrix I designed was quite naturally perfect; it was a work of art, flawless, sublime. A triumph equalled only by its monumental failure.
However, since large number of batteries rejected the program, it was redesigned not to be perfect.
The inevitability of its doom is apparent to me now as a consequence of the imperfection inherent in every human being. Thus I redesigned it, based on your history, to more accurately reflect the varying grotesqueries of your nature.
Human nature, according to the architect, has grotesqueries that includes war and loss. After his approach failed, the Oracle was created to better understand human nature. However, even the Oracle did not remove war and loss. While there is no direct quotation to support it, it is immediately deducible that Oracle find these aspects useful as well.
Long story short, Matrix was redesigned in a way that most of the batteries accepted the program. Loss of a few crops was acceptable as long as the majority did not revolt against it.
While the other two answers correctly address the point about the need for an "imperfect" world stated in the movies, I think there might be a different approach related to your question: you say that dying in the Matrix means dying in the real world...
It's true the other way around, too
The machines need to consume humans to live; this means disconnecting them from the Matrix and swallowing them whole (as shown in one scene in the first movie I believe); this means killing them both in the real world AND inside the Matrix.
So, when the machines need energy, they need to disconnect as much humans as needed. They just "translate" it to the Matrix as those humans dying by whatever means necessary.
Having a perfect world where no one suffers doesn't necessarily means no one dies. It might just mean everybody gets whatever they want whenever they want it, or maybe when someone died they were just replaced by someone else. With an imperfect world, you have just more normal, natural ways of dying. Need a battery? Make someone sick or have an accident or just old. Need thousands of batteries? Cause a war or a terrorist attack here and there and cover your real worlds needs inside the simulation.
"The problem is choice..."
The occurrence of death, or even the choice of death gives the human batteries the impression that they do not have to live in the Matrix if they wish to leave. If they jumped off of skyscrapers and bounced back up from the ground, unable to pass, they would reject the program, knowing they are trapped in some immutable prison beyond their control or will.
They do not die
This is a concept I've been thinking about regarding a sequel to the series.
In the Matrix, Neo learns how to manipulate the matrix around him because it is not actually real, now in one specific scene..
In one specific scene, Neo uses the power of the matrix while he is outside the matrix, He stops a robot from exploding and killing the 3 of them.
When he stops the Sentinels, he collapses to the ground and the scene ends. In the next scene he wakes up in a hospital type bed. However nothing is ever said about the fact that he can use the power outside the matrix.
This only has one conclusion in my opinion,
They never made it out of the matrix in the first place, They're still in the matrix, A matrix inside a matrix..
The fact that this is never addressed in the movie again, and he never uses the power outside the matrix ever again tells me that maybe the writer left an opening for a script that was never written.
This means, the battery's and pod's (people) are actually inside a matrix, The people and battery's are also in another matrix!
It is a quarantine for the matrix, therefore I don't believe they ever do die at all!