while a man was praying letting his lower garment trail, the Messenger of Allah (ﷺ) said to him: Go and perform ablution. He, therefore, went and performed ablution and then returned. He (the prophet) again said: Go and perform ablution. He again went, performed ablution and returned. A man said to him (the prophet): Messenger of Allah, why did you order him to perform ablution? He said: he was praying with lower garment trailing, and does not accept the prayer of a man who lets his lower garment trail.
Sunan Abi Dawud Book 2, Hadith 248