L and R poles are flipped using Rigify
Make sure your metarig's legs are set up correctly.
The only bend allowed in an IK chain is the one to indicate in which way it should bend. If you do it wrong, Blender will orient your IK wrong.
Also check your bones' orient.
As you can see below, I just shifted the metarig knees on the side and it generated the same way as yours.