When Beckett discovers the bags of drugs hidden in the bus-station locker, she cuts one open and tastes a bit of it to identify it as heroin. Although this is a very common thing for cops to do in TV shows and movies, it is strictly against actual police procedure. Aside from rules against law-enforcement officers ingesting any illegal drugs, there is also the chance that an unknown powder found during an investigation might be laced with an even more dangerous or lethal poison (anthrax, ricin, and cyanide all also have white-powder forms).
At episode's end, Beckett expresses her desire to have Castle around when she finds whoever hired Coonan to kill her mother. When she finally does so and brings them to justice, she admits that she couldn't have seen the investigation through without his encouragement and support.