How can I protect my kids from falling off of the top bunk in their rooms?

Not a podiatry ? I would consider putting up rails.
Supervision. Bunk beds are a major source of business for most ed's. Kids do all kinds of things on them. A simple rail will keep sleeping children from falling. Bunks should be for older children mature enough not to tackle each other from the "high ropes", not 3 year olds who think it's fun to balance on the rails. Like any equipment that is dangerous, you should assess the maturity of the child beforehand.