I have a kidney infection. Why does it hurt more when I'm up moving around compared to resting?

Because. The kidney is inflamed from infection and the kidneys move up and down with breathing and postural movement which causes stretching of kidney capsule which causes more severe pain.