Inmate William Douglas with horses in the Second Chances program at Wallkill Correctional Facility. Richard Beaven for The Wall Street Journal
Lots of prisons have vocational programs. But Second Chances, the one I visited last week at Wallkill Correctional Facility, about 80 miles north of the city, may be the most aesthetically pleasing of all.

Just as long as you don't get kicked in the head.

"I was scared," admitted Noel Jaminez, who comes from the Bronx and said he's serving time for assault. "I took the job because I was afraid of them. It was a challenge."

"Them" are retired racehorses that may have been injured, abused or neglected and have come to Wallkill to be rehabilitated by inmates through the Thoroughbred Retirement Foundation. During his former life in the Bronx, Mr. Jaminez didn't have much contact with horses such as Klabin's Gold, who was sired by Kentucky Derby winner Strike the Gold and has almost $350,000 in earnings.

"You stand behind the hip," he explained. "Lean your back against them."

Mr. Jaminez said working with horses has helped him address his violence and anger management issues.

"I never had any kind of patience," he said. "Dealing with these horses helped me have patience. You can't come at them if you're feeling aggressive."

The Thoroughbred Retirement Foundation operates the Second Chances program at prisons in 10 states. But the one at Wallkill, on an abandoned 50-acre prison dairy farm, was the first to be established—in 1984. The program celebrated its 30th anniversary with a ceremony last week.

Of Wallkill's 581 inmates, 14 work in the program. To qualify, the men must be "outside cleared," which means qualified to work outside the prison's security perimeter, and must have no history of sex crimes, or of absconding or escape, according to James Tremper, who has been the farm's manager and vocational instructor since the program's inception.

"We start with the real basics," Mr. Tremper told me. "Grooming. Animal health care: bandages, poultices for their infirmities. We do nutrition."

"They get out here and see they're the only one to provide for these needy animals," he added. "Most of them start coming around."

Inmate John Cook and one of the thoroughbreds during morning chores. Richard Beaven for The Wall Street Journal

Mr. Tremper cited one inmate in particular. "He's done every type of drug and as big a quantity as he can get his hands on." But working with horses has changed him. "He has a mission. He's found he's useful here. Whereas, he didn't feel important in anybody's life before."

Scott Coyle, a prisoner who said he's serving 3½ years for drug possession, talks about the five horses he's responsible for like a proud father whose kids made the honor roll.

"Globalization," he said pointing to a 9-year-old thoroughbred sired by Belmont Stakes winner Touch Gold, and with $102,972 in earnings. "He's a real gentleman. Only when the farrier comes he's not a gentleman."

Mr. Coyle would have liked to have watched this year's Belmont Stakes, where California Chrome ran for the Triple Crown. Unfortunately, he couldn't.

"I just heard about it afterward," he explained. "They had a facility movie on that day.

"I'm compulsive," he went on. "I was a heroin addict. This teaches me patience and it makes me introspective about myself. Especially the situation we're in—this spot is a little special when you can come out and do this."

He and the other inmates buy the horses candy—spearmints, candy canes—at the prison commissary. "We can bring almost anything out," he explained. "We can't bring it back in."

Some of the inmates hope to find jobs working with horses when they're released. But Mr. Tremper said Wallkill doesn't have a placement program. "It has to be done by outside agencies," he said, "and nobody has picked up that ball and run with it."

However, the Thoroughbred Retirement Foundation helps inmates find jobs—informally, said Diana Pikulski, the group's vice president for external affairs.

"I have connections in the horse industry," she explained. "When Jim calls me we start calling around.

"It's a little tough from here," she admitted, comparing New York to states with Second Chances programs such as Kentucky and Virginia with a larger horse industry and more jobs in the field. "Guys usually get paroled back to the city," she added. "Lots of times they want to be with their families and their families are in the city."

John Cook, a prisoner from Brooklyn serving time for burglary, wants to find a job working with horses when he gets released in February.

"I'm looking to move to South Carolina," he said. "They told me they have a lot of horses down there."

He glanced at the horses in enclosures named after New York state prisons—Sing Sing, Altona, Attica.

"They're locked up like we are," he observed. "I can't keep coming back to these places."

Upon reflection, he realized the horses were freer than he was.

"They don't have to sit in here and deal with doing a [head] count."