Soapy has been committing and attempting to commit petty crimes in the hope of being arrested and sentenced to three months in jail. He has been doing the same thing every year in the late fall and has always succeeded in getting room and board in a warm jail during the winter months. But this time it seems as if fate is against him. He is baffled. Then when he hears the organ music coming from the church he is held "transfixed." He is experiencing a religious epiphany. He feels that God has been telling him to reform by preventing him from getting arrested. This epiphany is the result of three things: his failure to get arrested, the beauty of this little church (which apparently he has never seen before), and the beauty of the organ music. But the anthem is deceptive. God cares nothing about him. Soapy is beyond redemption. His destiny is already sealed. The epiphany has actually had an ironic result. Soapy is oblivious of his surroundings. He does not realize that he has strayed too far from his regular haunts and that he looks like a vagrant and a loiterer standing there pressed against the iron bars of the fence, which is set up to keep people like him outside. He is arrested and sent to Blackwell's Island for three months as he originally wanted.
O. Henry is expressing his own feelings in this story. He served a little over three years of a five-year sentence for embezzlement in Ohio State Penitentiary and never got over it. He used a pen name instead of his real name of William Sydney Porter because he was trying to keep his criminal record a secret from everyone. The theme of his story is that once you are outside what he calls the world of "mothers and roses and ambitions and friends and immaculate thoughts and collars," like Soapy in "The Cop and the Anthem," you are out for good. There is no way back. O. Henry had a terrible drinking habit. At the time of his death he was said to be consuming two quarts of whiskey a day. He died at the age of forty-seven of cirrhosis of the liver. His heavy drinking is probably attributable to his feelings of shame, guilt, remorse, and depression. His sympathy for the underdog, so apparent in many of his stories, was due to his feeling like an underdog himself.
"The Cop and the Anthem" starts off with a heavily comical stylistic tone. All of the tricks that Soapy tries in his efforts to get himself arrested have their comical side, including the encounter with the umbrella man and his failed attempt to be a "masher." The episode in which he hurls a cobblestone through a plate-glass window seems like something we might see in a Charlie Chaplin movie. The comedy is intended for the sake of contrast with O. Henry's surprise ending, which seems especially tragic now that Soapy has had a religious experience and made the decision to reform.