Acids can oxidize iron since the redox potentials $E$ for $\mathrm{pH} = 0$ show that $\ce{H+}$ can oxidize $\ce{Fe}$ to $\ce{Fe^2+}$; but non-oxidizing acids cannot further oxidize $\ce{Fe^2+}$ to $\ce{Fe^3+}$:
$$\begin{alignat}{2}
\ce{2H+ + 2e- \;&<=> H2}\quad &&E^\circ = +0.000\ \mathrm{V}\\
\ce{[Fe(H2O)6]^2+ + 2e- \;&<=> Fe}\quad &&E^\circ = -0.440\ \mathrm{V}\\
\ce{[Fe(H2O)6]^3+ + e- \;&<=> [Fe(H2O)6]^2+}\quad &&E^\circ = +0.771\ \mathrm{V}\\
\end{alignat}$$
However, oxygen can oxidize $\ce{Fe^2+}$ to $\ce{Fe^3+}$:
$$\begin{alignat}{2}
\ce{O2 + 4H+ + 4e- \;&<=> 2H2O}\quad &&E^\circ = +1.229\ \mathrm{V}\\
\ce{[Fe(H2O)6]^3+ + e- \;&<=> [Fe(H2O)6]^2+}\quad &&E^\circ = +0.771\ \mathrm{V}
\end{alignat}$$
Therefore, iron is oxidized to $\ce{Fe^3+}$ in dilute hydrochloric acid when in contact with air.