I think you might need to take a step back and revisit your design. My opinion is that the overall design is flawed even before you consider the joinery.
Your first step is to simulate what this bed might be like once you build it. Take an example of the rails (the pine boards) you intend to use and place it across two blocks, roughly the largest distance you expect to span.
Now, sit on the board and bounce up and down a little. I suspect you are going to get a lot of deflection, and maybe even some ominous splitting noises. Unless you use many legs so the spans are very short this is going to be a problem with any design using planks as load-bearing rails.
There are ways around this by using the wood how it is strongest (on edge, like a floor joist) and combining that with another piece to make an L-shaped rail. Obviously, there are many other ways to do this, like using metal, or putting the rails on a proper carcase (or frame).
I recommend looking at more bed designs and seeing what I mean. Even store-bought flat-pack furniture can give you lots of ideas.
To answer your question: if you fasten ordinary pine on edge like this, with the fasteners through the end grain at the ends, it'll split and tear out of the fasteners in a season or two. Ignoring the problems with the design, a half-lap across the feet to tie the structure together, along with fasteners that allow for grain movement might be better.
In fact, I wouldn't use fasteners through the rails/boards at all. I'd use the fasteners that are used to hold table-tops to the apron or legs, which are designed to allow the table-top to move with seasonal changes. Fasteners through pine like you show would also weaken the rails, and encourage any potential shakes (splits inside the board) to emerge.