Why do you sometimes have to press the device rotation tile twice for it to function?
When you tap that button, what is actually happening is a settings file in the phone is updated. If it isn't working on the first tap, it's either caused by lag, or an issue with the quicksetting pane itself. There isn't much you can do as far as a real solution besides a factory reset or using a custom ROM.