Sahih Muslim Hadith 5022, narrated by AbuHurayrah
Allah's Messenger (peace be upon him) said: None of you should drink while standing; and if anyone forgets, he must vomit.
Sahih Bukhari V7 Hadith 520, narrated by An Nazzal bin Sabra
'Ali offered the Zuhr prayer and then sat down in the wide courtyard (of the Mosque) of Kufa in order to deal with the affairs of the people till the 'Asr prayer became due. Then water was brought to him and he drank of it, washed his face, hands, head and feet. Then he stood up and drank the remaining water while he was standing. and said, "Some people dislike to drink water while standing though the Prophet did as I have just done."
Obviously, it is BETTER to drink while sitting down, but it's not HARAM to drink while standing.It is disliked to eat or drink on the street. It is [somewhat] disliked to eat standing or walking, while it is not wrong to drink standing .However, one should not drink while walking, though it has been allowed for travelers.
Amr ibn Shu’aib radiyallahu anhu relates from his father, and he from his (Amr’s) grandfather, that he said, “I had seen Rasoolullah sallallahu alaihe wasallam drinking water whilst standing and also whilst sitting.”
Commentary
There are many narrations mentioned wherein Sayyidina Rasoolullah sallallahu alaihe wasallam prohibited the drinking of water whilst standing. A narration of Sayyidina Abu Hurairah radiyallahu anhu is mentioned in Sahih Muslim that Sayyidina Rasoolullah sallallahu alaihe wasallam said, “No person should stand and drink water, and if one forgetfully stood and drank it, it should be vomited out.” Some ulama have summed both the deed and the prohibition in a few ways. Some ulama are of the opinion that the prohibition came later and repeals the previous law. Some ulama hold the opposite view that the narrations where he stood and drank water repeals the one that prohibits it. According to a well-known saying, the prohibition is not that of a Shar’ee or unlawful nature, but as an etiquette. It is also a blessing and kindness. Ibn Qayyim and others have mentioned the harm that standing and drinking causes. In short, Sayyidina Rasoolullah sallallahu alaihe wasallam standing and drinking shows it being permissible to do so, and that it is not haraam to stand and drink water. It is best not do so, as this is against the recommended practice and one will be committing a makrooh act by doing so.