There were, I think, around three thousand police, almost all the GPD's active duty force. They were there the full five months (or however long). And they were being fed, probably by Bane.
It could be they looked good because whatever GPD commanders and NCOs were down there decided that it would be bad for morale to go around looking like unshaved, shaggy-haired scarecrows dressed in rags. After all, they didn't have much else to do down there! Allowing them a few razors and clean uniforms affords them some hope that Bane will then crush for... reasons.
Bear in mind Bane's motivations simply weren't rational. He said he wanted them to join the revolution, something, something, who knows? Something more about fear and hope. Etc. He was on a suicide mission anyways, carrying out Ra's al Gul's plan. If simply destroying Gotham was the plan then they could have done that as soon as they had the bomb, with Batman/Wayne watching it happen on TV from prison.
One tentative reason for keeping the police alive is this is part of the ruse of wanting to rule Gotham instead of destroying it. That is, as long as the police are being kept alive by Bane the government might still think it has time to put in motion its own plans and/or Bane is capable of negotiating in good faith. If the police are slaughtered they might realise his plan is to destroy Gotham all along and put into motion more active plans. (Fun fact, as the bomb is being driven around in trucks could easily be taken out by an EMP, or for that matter a drone-launched Hellfire missile or precision-guided weapon without detonating. Heck, you could do the latter even with a military nuclear device, but I digress.)
Two-A, following from this, the lives of the police are bargaining chips to be used in some hypothetical future negotiation with the government, again, as part of Bane's overall ruse. By keeping them alive he appears merciful, even reasonable to the people of Gotham and the US government. Dead, they are worth nothing.
Two-B, The people of Gotham seem to be keeping their heads down. Not joining Bane wholeheartedly but not offering large-scale resistance, either. The people of Gotham are offered some hope that Bane is not a complete monster and is capable of sparing his enemies in some fashion. If Bane simply slaughters the police the people of Gotham might realise their only hope is to resist because Bane is a madman and they have nothing to lose.
Three, their lives are essentially being held hostage for the government's good behavior. The government already knows Bane is bluffing somewhat; sending in Special Forces resulted in their death but did not trigger a maximum response of Gotham's destruction. This is also a real-life problem with nuclear war and "Mutual Assured Destruction": a massive strike might trigger a maximum response, but what if instead of a thousand incoming ICBMs there's only twelve? Or Three? If your only creditable option is to burn everything down to the ground you have a difficult choice! The outcome of this was a set of "Limited Nuclear Options" (LNOs), limited retaliatory strikes short of all-out retaliation. In the same fashion by keeping the GPD officers alive but trapped Bane has a threat in his pocket that is a step short of escalating to thermonuclear oblivion. For example, if the government attempts to infiltrate Navy SEALS into Gotham Bane can send in his goons to kill a thousand police in retaliation instead of triggering Gotham's complete destruction. This seems like doing things the hard way because the police are still armed and capable of resisting but it's clear Bane doesn't value the lives of his men, who will also give their lives for him. Again, this is only in service of keeping his main ruse going.