A thief who stole women’s underwear from a washing line while on his way to a gym has been sentenced to 10 months in prison.