why does iron dissolve in HCL to form FeCl2 and not FeCl3
Let us see the equation as:
2HCl + Fe -> FeCl2 + H2
Here, the hydrogen atoms bond together to create hydrogen gas, and the two chlorides will bond with the Iron. since each Chloride has a -1 charge, and the Fe has a 2+ charge (two electrons) in its valance shell, these two electrons will each form bond with one chloride. Thus the Iron forms two bonds,in which one single bond to each chloride.
Since its valance shell has been exhausted and there are no other unbonded elements in the equation, there is no way left for the iron to obtain another electron, and thus it can not form Fe+3 ion (which would make iron (III) chloride).
And, the liberated Hydrogen gas may reacts with available oxygen and converts into water molecules so that, no further chances of oxidation of Ferrous to ferric state.