Is spruce wood a good choice to make a bunk bed?
It seems like you are actually asking several questions here, so I'll break down my answer:

Is spruce appropriate?

short answer: yes. A softwood like spruce will be relatively inexpensive, and plenty strong enough if you use thick enough pieces. Be aware that it may dent more easily than a hardwood. For a project like this, almost any kind of wood will be fine (I would avoid balsa or basswood). Plywood would be another economical and appropriate choice for the slats.

How do I decide on appropriate dimensions?

Although you can do engineering calculations to come up with the answer, the easier way is to get used to material, follow some general guidelines, and err on the side of too-strong.


Handle the material. Try to bend it. Look at similar designs. Now you're ready to start guessing. I know this sounds silly, but that's how furniture has been designed for thousands of years. It is easy to build an intuition for the properties of wood once it is in your hand. You can do basic strenght/stiffness tests of the horizontal members by spanning them across some impromptu supports (like milk crates) and sitting in the middle. If two long beams have to support two people, test with one person on one to make sure it doesn't bend much. One person on half the slats (laid out side by side), should bend them a little (depending on preference), but not be in danger of breaking.
Horizontal beams gain the most stiffness from being tall, not wide. For example, if a beam (such as one of your slats) that's 1cm (tall) x 4cm (wide) isn't stiff enough, you can double the stiffness by making it 1.26cm x 4cm, or 1cm x 8cm. (1.26^3 ~= 2, see https://en.wikipedia.org/wiki/Bending_stiffness for more)
You need solid joinery to prevent the whole thing from turning into a parallelogram and falling over. This could mean mortise-and-tenon, pocket screws, nails, glue, biscuits, dowel-joints, or brackets. I can't see your brackets, but if they look flimsy and there aren't a lot of other options you could double up with one on top and one on the bottom.


dowel joints may be an easy and strong alternative. You can do them without any difficult alignment if you don't mind them showing: put the boards in place and clamp them firmly so they don't move relative to eachother. Drill a hole through one board and into the end of another. The ideal size of the hole would be approximately 1/3 of the board you're drilling into. Put glue on a dowel of the same diameter and pound it into the hole with a mallet. Cut off the excess dowel with any kind of hand saw, and sand it flush. Repeat this so you have at least 2 dowels, depending on size. If you are joining multiple boards at the same point, such as where your horizontal pieces attach to the posts, be mindful that the dowels don't interfere. The beauty of this approach is that it approaches the strength of the mortise-and-tenon, but requires no measuring or alignment. The holes don't even have to be straight.



Is my design adequate?

Your design looks pretty plausible. I think the brackets and the slats seem to be the only potential weak points. If they prove problematic, try some of the stuff I mentioned above (double brackets, dowel joints, thicker slats).

disclaimers

Bad design choices could cause injury, so please don't take my answer as gospel truth. Use your own judgement and testing to make final decisions. You are responsible for your own safety.

Sorry for the wordy and possibly overly detailed answer. I have attempted to organize it and use words that will be easy to look up elsewhere, since there is a lot to convey.