In one scene, Beckett promises Castle that, when they decide to have a baby, he won't have to raise it by himself like he did with Alexis. In the CSI: Miami (2002) episode "CSI: Miami: Deep Freeze (2007)", Stana Katic plays a woman suspected of committing a murder; her character is a mother who lost a child that she was raising by herself.
Many counties (and other child services jurisdictions) have foster homes that specialize in "shelter care." These are the homes that take care of children on an emergency basis, sometimes prior to paperwork being completed and often up until the court determines the long term placement of the child (adoption, back to the biological parent or family member, or to a long term foster home), an average of 2-4 months. Child care organizations often organize their shelter care foster homes so that at least one licensed for each age group is available, rather than let all be out of town at the same time as is the case in this episode.
The trivia item below may give away important plot points.
About three-quarters of the way into the episode, Castle determines that the motive for the murder is the fixing of the pick six lottery. This storyline is loosely based on the 1980 "Triple Six Fix" lottery scandal in Pennsylvania, which also loosely served as the basis for the film Lucky Numbers (2000).