How can I fix this mesh rotation issue?
You have to assign weights to meshes you want to move with a bone.

(After selecting your mesh and armature and parenting using automatic weights)


Select your armature and press ctrltab to enter
pose mode
Select your mesh and press ctrltab and then you can assign weights to parts to want to move with the bone