In the laboratory preparation of ammonia, ammonia is collected by downward displacement of air.
Ammonia gas can not be collected over water because this gas is highly soluble in water and due to its high solubility. We are unable to collect it over water.
Ammonia on reaction with water gives hydronium ion and ammonium ion.
Chemical equation:
So, ammonia is collected over mercury.
So, this is the reason why we can not collect it over water.