WHAT THE HELL is going on with the city jails lately?

* Capt. Deurward Spellman, director of the Philadelphia Prisons Training Academy, has been accused of having an affair with a current cadet and inappropriate relations with members of past classes. This week, he was moved from the academy to a new post at the Detention Center while an investigation gets underway.

Related stories

* Detention Center Warden John Delaney has been disciplined for mishandling money while he was head of Curran-Fromhold Correctional Facility. The money belonged to the prison officers' "sunshine club" and was supposed to be used for officer activities. He was given a written reprimand.

* Michelle Brooks, the former social-services manager at the prison, was convicted last week of smuggling marijuana to inmates after at least 18 tested positive for the drug. Her defense? "She did say that everybody [in the prison] does this," her lawyer told the Daily News. "She wasn't the first, and she's not the last."

* Copies of two unsigned letters, apparently penned by a disgruntled employee, were circulated in the prisons within the past month, alleging on-the-job employee behavior that, if true, ought to result in firings for some and criminal charges for others.

We're talking about sex between officers and inmates, between correctional staffers and each other, between underlings and superiors. Drug use. Securing contraband for inmates. Rampant lateness and doctoring of time cards. Officers leaving posts unattended while they take long lunches or socialize with prisoners, who wander freely in areas that are supposed to be restricted or locked down.

Oh, and napping - lots and lots of napping.

Worse, the letters allege, the offenders are in favored cliques, which means their supervisors overlook their behavior. Unconnected workers get written up for piddling offenses.

"I don't know who wrote the letters," says a prisons employee who contacted me to vent about working conditions, "but I believe that everything they wrote is true [because I've seen it]. We complain to Internal Affairs but nothing gets done. We're sick and tired of it."

The Philadelphia Prison System operates six major correctional centers on State Road and satellite lock-downs elsewhere.

Prison Commissioner Louis Giorla says he is investigating the letters' allegations. The feds may be beating him to it. A source says the FBI has been questioning workers about activity in the prisons. An FBI spokeswoman wouldn't confirm or deny that, but it's not like the prisons haven't been under the bureau's microscope lately. The FBI investigated prison guard Dion Reid, who was charged in February with attempting to sell and distribute contraband drugs, cellphones and cigarettes to inmates.

No wonder the decent workers I've been speaking with say employee morale is in the tank.

"Morale is always bad," responds Giorla, who used to work in the prison system's Internal Affairs department. "This is a very tense and stressful environment for everyone who works here, whether they're a corrections officer or a support person. They do an extraordinary job, and we know we have an obligation to treat them as fairly as possible."

When it comes to supervisors, he says, "We don't take lightly."

That's not the impression many officers have. For example, they're disgusted that Warden Delaney got a wrist slap for the Curran-Fromhold sunshine-club debacle.

For years, the club's account had been funded by partial proceeds from prison vending machines (which are managed by an outside vendor) and employee-led fundraisers. Back in 2007, though, club members bought their own beverage machine, which they stocked with bottled water for sale.

The machine earned, monthly, anywhere from $400 to $1,200 (more in summer, less in winter). Each time the machine was restocked, the money in it was counted and deposited into the club's bank account with Police and Fire Federal Credit Union.

The trouble started, employees said, when Delaney ordered an employee to remove the machine money, deposit the change but give the bills to him, without counting it.

The employees allege that the club's usually precise book-keeping records became a mess under Delaney. Accusations of theft were hurled - employees said up to $6,000 was unaccounted for - triggering an investigation by the city's Office of Integrity and Accountability.

Delaney was issued a written reprimand and told to adhere to the sunshine club's strict accounting rules. Giorla says the punishment was adequate, since the amount in dispute was only about $1,300 and Delaney had receipts for other missing funds.

Delaney didn't comment for this column, but his attorney, former prison commissioner Leon King, calls the investigation of Delaney a "vendetta" and "harassment."

Absurd, says Michael Resnick, the city's director of public safety, whose office oversaw the investigation.

"We get complaints, and it's our job to investigate them. We got quite a few complaints about Warden Delaney," says Resnick, who was the director of legal affairs for the prison when King was commissioner. "We're not going to not investigate him because it might hurt his feelings. Leon King knows that."

What I know is that the employees I've been speaking with seem like good people who are feeling beaten down in a dangerous place where competence and hard work appear to be trumped by connections and politics. And where it can be hard to tell who really deserves to be behind bars.

So here's a suggestion for Giorla. This is National Correctional Officers Week. In recognition, the Philadelphia Prison System is planning a picnic for employees.

But a better way to honor them would be to listen to and investigate their complaints impartially - and if infractions have occurred, to mete out discipline fairly, regardless of rank or connections.

Anything less would be a crime.

Today on PhillyDailyNews.com: Read the letters that piqued Ronnie Polaneczky's interest in a story about troubles at the city's main prison.

Phone: 215-854-2217

On Twitter: @RonniePhilly

Blog: ph.ly/RonnieBlog

Columns: ph.ly/Ronnie