Beckett investigates the murder of a wealthy woman named Victoria Westlake, who was killed by someone armed with a nail gun. She calls Castle to say meet her at the crime scene, but he's already there. Castle went to boarding school with the victim's husband, Damian Westlake. He's positive his old pal had nothing to do with his wife's murder. Beckett, however, thinks her partner may be too close to the case.
Damian says his wife fired a construction worker who was doing renovations on their townhouse. The victim's employee, Amber Patinelli, confirms the carpenter was fired because she stole Vicky's engagement ring. But the carpenter says Mrs. Westlake found the missing jewelry piece and later apologized. An inventory of the victim's valuables confirms that the ring is, indeed, still around.
Beckett believes Damian is the prime suspect. Castle doesn't buy it. He's known the guy since boarding school and he was the first person who ever told him he had a talent for writing. That's why it's tough for him to hear that his old friend was a prime suspect in another murder that occurred two decades ago in Puerto Rico. The victim: Damian's father-Phillip Westlake.
Beckett has a chat with Vicky Westlake's first husband, Simon Campbell. The guy is bitter that his wife left him for a spoiled man like Damian. Simon lives in the building that houses his ex-wife's business, so he still saw her frequently. They had even talked about getting back together. Beckett finds this odd since Damian had said he and Vicky were quite happy.
Beckett lets Castle back on the case, though she's sure he won't like the incriminating financial info they dug up. Damian spent all of his inheritance wooing Vicky. The guy's been sponging off her ever since. A tagger spotted at the scene says he heard Vicky and Damian arguing before the murder. She called him a liar and a thief. She also spoke of divorce which would leave Damian broke.
Things don't look good for Castle's old pal when news of an affair comes to light. Even with overwhelming evidence, Castle can't believe Damian is capable of murder. He tracks down a postal worker who saw Mrs. Westlake alive shortly after seeing Mr. Westlake on the street. Damian couldn't have killed his wife.
Beckett still believes Damian could have hired someone. Castle thinks she's being influenced by her suspicions over the unsolved mystery surrounding his father's death. So Castle decides to solve it. He gets a little help from Alexis, who has just completed her Valentine's Day shopping for Ashley. She got him a framed picture his dead pet rat. Nothing says love like rodents.
Beckett realizes that Damian had the diamonds in Vicky's engagement ring replaced with fakes so he could sell the real ones for cash. But when Damian produces the diamonds, Beckett starts to think Castle was right. The guy's a loser, but probably not a killer. Regarding the cold case of Damian's dad, Castle recognizes a sketch of an indentified person of interest. It's a sociopathic Damian got kicked out of boarding school. Killing his dad could have been his revenge.
Ryan and Esposito discover that Vicky's ex-husband, Simon Campbell, would still get money should she die. He was having cash problems as well as an affair with Amber Patinelli, who was blindsided when she realized Simon was thinking about getting back together with Vicky. Amber ultimately admits to killing her boss. Case closed.
Actually, two cases are closed. Castle tells Damian that their old boarding school classmate has been arrested for murdering his dad. The guy made a deal with the D.A. in which he revealed that Damian had set the whole thing up. Castle is crushed, but Beckett's there to help him through this difficult time. One way or another, these two were meant to be together on Valentine's Day.