How to secure a stacked ikea kura bed
IKEA furniture is pretty well engineered, and by that I mean, they make it just about strong enough to be used as intended by the manufacturer.  There isn't a lot of overstrength to accommodate weird uses.  If the manufacturer intended that to be done, Both these would be true: 


An explanation on how to do it would be included in the instructions for the bed.  And 
A testing lab such as UL, TUV, CSA, etc. will have tested the design, and certified it to be safe.


If either of those things is not true, then either a) do not do it, or b) build a cantilevered or ceiling-hung platform to carry the weight of the upper bed even if the lower one is removed.