You have a couple of problems.
First, lets start in edit mode.
1. Fix the roll. Select the thigh and shin bones. Press shift+n->Global X axis.
2. Remove Z lead. Select the thigh bone. On N-panel under head put mouse cursor over X input field and press ctrl+C. Then move mouse cursor over X input field under Tail and press Ctrl+V.
3. Select tail(Small end of the bone) of the sheen bone. Press shift+s->Cursor to selected. Then select body of the IK CTRL bone and press shift+s->Selection to cursor.
4. [Optional but a good practices] Line up knee pole with world. With mouse cursor over Z under head press ctrl+c. Then move mouse cursor to Z under Tail and press ctrl+V. Set Roll to 0.
Second, In pose mode.
1. Select Shin. On the IK Constraint change target bone from Foot to the IK CTRL.
Third, Additional information. What is happing is that there is to much of a bend along the joint’s Z axis thus Blender moves in both directions(Z and X). The Joint is where the thigh and Shin meet. The joints Z axis moves along the global X axis which is why I copied and pasted the X axis of the head and tail. You could also fix this by moving the joint further forward on the X axis, but this lead to having to reweight around the knee and calf. That’s why I choose to do the Joint’s Z axis. Fixing the roll just gives a better deform with deeper bend of the leg. As for the Pole target, it’s just common practice to have it straight. I don’t know if it really makes a difference in Blender. The reason I snapped the IK to the Shin is so that when you set the correct Target on the constraint the shin wouldn’t jump and cause weird deformation in the ankle.