There are seven elements that naturally occur as homonuclear diatomic molecules in their gaseous states: hydrogen, nitrogen, oxygen, fluorine, chlorine, bromine, and iodine.
The only chemical elements that form stable homonuclear diatomic molecules at standard temperature and pressure (STP) (or typical laboratory conditions of 1 bar and 25°C) are the gases hydrogen (H2), nitrogen (N2), oxygen (O2), fluorine (F2), and chlorine (Cl2).
Now, Let us see our first equation which is redox reaction.
[tex]\frac12H_2 + \frac12Cl_2 \rightarrow H^+Cl^-\tag{1}[/tex]
In (1), H2 is reducing agent and Cl2 is oxidizing agent.
Now,look at the second reaction.
[tex] H^+ Cl^- \rightarrow H^+Cl^- \tag{2}[/tex] No reaction takes place in (2).
That's why reaction equation (1) is correct and reaction equation (2) is wrong.