How can I fix the rotation for this hand?
you have to rotate them in edit mode by pressing R + the axis to rotate (you are wanting to align the bone rotations so you have to select if i am not mistaking the Y axis must be) and rotate the by a value of 90  or -90. ensure that the armature its not assigned to a mesh because it may get really bad bug in your mesh if you are editting it (the armature) with it, so you have to clear the parent and when you are done fixing it parent it again.