The main reason why your headboard may be moving is loose bolts. Ensure that each bolt is properly tightened onto the bed frames but not too tight that it can cause damage to the wood frame.