The Gemara in Masechet Shabbat (43) establishes that if water leaks from one’s ceiling on Shabbat, he may not place a utensil underneath the leak in order to catch water. The reason for this Halacha is the prohibition of “Mebatel Keli Me’hechano,” or rendering a usable utensil Mukse on Shabbat. Since the water leaking from the ceiling is dirty and unusable, it has the status of Mukse, and, by extension, if it falls in a pail, then the pail becomes Mukse. Halacha forbids making a utensil Mukse on Shabbat, and it is therefore forbidden on Shabbat to place a pail or other utensil underneath a leaking ceiling to catch the dirty water.
The Be’ur Halacha (supplementary essays to the Mishna Berura by Rabbi Yisrael Meir Kagan, 1839-1933), toward the end of Siman 338, raises the question of why it is permissible to wash Netilat Yadayim or Mayim Aharonim into a utensil on Shabbat. When we wash Mayim Aharonim after a meal, we customarily pour water over our fingers and the water falls into a utensil underneath. Similarly, many people keep a washing cup and basin next to their beds, and wash Netilat Yadayim in the morning by pouring the water over their hands into the basin. Water with which one washed his hands for Mayim Aharonim or Netilat Yadayim is considered unusable by virtue of the “Ru’ah Ra’a” (“evil spirit”) that descends upon it. Seemingly, then, it would be forbidden to wash Mayim Aharonim or Netilat Yadayim into a utensil on Shabbat, as one thereby makes the utensil Mukse, since it collects water that is Mukse.
The Be’ur Halacha proposes two explanations for why it is permissible to wash Mayim Aharonim or Netilat Yadayim into a utensil on Shabbat. Firstly, the Tur (Rabbi Yaakob Ben Asher, Spain, 1270-1340) maintains that in situations of need, a person is allowed to collect dirty water in a utensil. For example, if he would be unable to use the room in question with dirty water dripping down from the ceiling onto the floor, then he may collect the water in a pail. Similarly, the Be’ur Halacha contends, for the purpose of washing Mayim Aharonim or Netilat Yadayim the Tur would allow pouring the water into a utensil, even though the utensil now becomes Mukse. The Be’ur Halacha comments that although we generally do not follow the Tur’s position, we perhaps may rely on it with regard to Mayim Aharonim and Netilat Yadayim.
The Be’ir Halacha then suggests a different approach, noting the fundamental distinction between the cases of the leaking ceiling and hand washing. The water that leaks from the ceiling is intrinsically unusable because it is filthy. As such, it assumes the status of Mukse on Shabbat. Water used for Mayim Aharonim or Netilat Yadayim, however, is intrinsically usable, but practically we refrain from drinking or using this water because of the “Ru’ah Ra’a” that rests upon it. Since the water’s intrinsic properties do not render it unusable, it does not have the status of Mukse, and it therefore does not make the utensil Mukse. Hence, it is entirely permissible to wash Mayim Aharonim or Netilat Yadayim into a utensil on Shabbat. (Listen to audio recording for precise citation.)
Summary: It is forbidden on Shabbat to place a pail or other utensil underneath a leaking ceiling to collect the water. It is permissible, however, to wash Mayim Aharonim or Netilat Yadayim by pouring water over one’s hands into a utensil.