Is it true that the prophet condemned those who wore any garment below the ankle, and is it true that it’s haram to wear pants below the ankles?

It’s Makrouh for men to wear clothes below the ankles. There are two main reasons why:

1- In the past, streets were littered with impurities and Najasaat. It was recommended to have one’s garment above the ankles so it would not get contaminated with those impurities.

2- Women would wear long garments that would touch the ground. Men were discouraged from wearing garments that resembled women. Remember that in the past men would wear long garments/dresses similar to what women would wear, so having their garment shorter would make them appear distinct from women. Islam did not want men and women to resemble each other in their clothing.