Parenting Armature to Mesh with Automatic Weights deforms Mesh
The problem is that the rest pose is different from the pose pose which makes the the mesh deform badly as you showed. To fix this you'll need to go into Pose Mode, select all bones then press the space bar and type "Apply Pose as Rest Pose" then run the Apply Pose as Rest Pose operator as shown below:



This will fix your issue and parenting will be done without bad deformation as shown:



Looking at the weight painting done through the automatic weight painting, I found that the vertex groups are not properly made through the auto weight painting, as shown below the upperleg vertex group has lots of vertices assigned to this group although they shouldn't, so the better thing to do is to do the parenting with empty groups and then setting each vertex group manually through edit mode to prevent these automatic weighting issues.