Indicted in an extortion scheme that portrays him more like a gangster, Castro became the 15th member of the Police Department to be arrested since March 2009.
Six of the officers were taken down in three drug investigations, four were charged with sex crimes, and two faced murder charges after off-duty shootings.
The sudden jolt of arrests can't be explained by Ramsey's oft-cited commitment to root out corruption.
A third of the officers were caught in federal investigations, and two others were nabbed in a sting after state investigators got a tip about cops working with drug dealers.
The sheer number of arrests has left the department's leaders embarrassed, and focused their attention on the city's police culture, particularly a code of silence whereby many honest officers - the great majority of the force - feel unable to turn in those who betray the badge.
Friday morning, Ramsey held a citywide conference call with his commanders to discuss Castro's arrest. He sent out a four-page message that afternoon to be read at roll calls for the next four days.
His message to the troops: This has to stop.
"There is no higher priority for every single member of this department . . . than ensuring that we police ourselves," Ramsey wrote. "We cannot afford to have our legitimacy . . . slip away at the hands of a few, who leave a black eye on all of us who remain."
Commanders who participated in the morning call said Ramsey had told them to reinforce the department's values constantly through the ranks, because "if the public doesn't have confidence in us, we can't do our jobs."
"We've got to get back to getting people to understand what it means to be a police officer," one commander said. "We are, in fact, public servants. We serve the public."
Even in a police force as large as Philadelphia's - with about 6,500 sworn officers - the arrests of so many officers in such a short time have been "a streak of bad luck like I've never seen in my career," said John McNesby, president of Fraternal Order of Police Lodge 5, the city's police union.
"Either you want to be a gangster or you want to be a cop," he said. "I just hope we're coming to the end."
But Ramsey acknowledged Friday that there were open criminal investigations into other officers.
"We do have a percentage of individuals who feel they're above the law," he said after a news conference at the U.S. Attorney's Office. "I expect us to be standing here in the future."
As the last 18 months of embarrassing arrests have unfolded, Ramsey has made a series of changes.
He has beefed up Internal Affairs to 138 officers, and assigned a team to work with the FBI to investigate corruption.
The department launched a hotline and e-mail address to log public complaints, and officers are receiving more ethics training, more often.
Ramsey also plans to raise the age limit and educational requirements for recruits.
"We're putting the resources in," he said. "We're going to fix this problem."
Commanders said Ramsey had talked about the need for a cultural change in the rank-and-file, doing away with the "blue wall of silence" and sense of entitlement that some officers display in public.
"It's just an attitude. It's a culture," the commander said. "He's upset with the fact that a few people can make the rest look bad and there's this culture of, 'Well, I'm not going to say anything.' "
That attitude, sources said, has been embraced by many of the arrested officers. Of the 15, so far, only one has shown remorse that he had "tarnished the badge."
Investigators said they were particularly disturbed by the nonchalant attitude of Officer Christopher Luciano after he was arrested in a drug sting last month. Sources said he had taken off his police uniform shirt, rolled it up, and used it as a pillow in the lockup.
"It's upsetting. It's embarrassing," a commander said of the spate of arrests. "For those that sacrificed their lives doing their jobs, this isn't the image of the department we want."
In his written message, Ramsey called on "every single person here to step up and say something when they know about those who are abusing their position."
"Respect the values we live by, make them a part of who you are," he wrote. "This is how we will restore our reputation. Our future depends on it."
Contact staff writer Troy Graham at 215-854-2730 or email@example.com.
Inquirer staff writer Allison Steele contributed to this article.