Well, they started working with this 'CIA' agent (played by Jennifer Beals) who used to be a former muse of Castle.. for one of his previous book series. Castle followed her around, just as he does with Beckett right now. And it turned out, they also slept together. Beckett can't stand her because she's taking over her case and is just.. ugh.. and you can see, Beckett is also jealous!
And when she told him. 'sleep with whoever you want, the more the merrier' .. she didn't notice Castle's daughter Alexis was also there.. (she's making an internship in the morgue/lab).. and she didn't really need to hear about her dad's sex life. So yeah, that moment was quite awkward.