This is because gaseous HCl does not dissociate to give up protons and chloride ions. But, in aqueous solutions HCl does dissociate and exist in ionic form:
H2O(l)+HCl(aq)⟶H3O+(aq)+Cl−(aq)HX2O(l)+HCl(aq)⟶HX3OX+(aq)+ClX−(aq)Thus it acts as a typical Bronsted acid (proton donor) in an aqueous environment. In this case, water is gaining a proton (H+)(HX+), so it is a base, while HCl is giving one away, so it is an acid.
Therefore it is able to turn the blue litmus paper red (a behaviour typical of acids).