Toddlers moving bed

I have a 3 year old daughter and a 2 year old daughter. The oldest is in a twin size bed and the younger one is in a toddler bed, they pull the mattress off the twin size bed and they flip and move the toddler bed all over the room and pick it up and let it fall against the walls. I have been trying to find ways to keep the twin size mattress from being able to be pushed off the box spring and keeping the toddler bed against the wall.

I can’t find anything to help on google, does anyone have any advice on how to keep them from moving their beds, I don’t want them to get hurt.