Due to surface tension, the free surface of liquid at rest behaves likes a strectched membrane. When an iron needle floats on the surface of clean water, its weight is supported by the stretched membrane, when some detergent is added to this water, its surface tension decreases. As a result of it, the stretched membrane on the surface of water is weakend and is not able to support the weight of needle. Hence, needle sinks in such water.