To my understanding, it is forbidden to dress untidily. Where is the source for this?
A source which comes to mind is Shabbas 114a which talks about talmidim chachamim who are obligated to dress nice and the gemera goes so far to say that one is chayiv missa if they have certain stains on their clothing .
The Rambam codified this in Hilchos Deos 5:9 . From what I know it is only talking about a chacham (talmid chacham).
Messilat Yesharim 20:23: (Sefaria.org translation)
Our Sages of blessed memory tell us (Shabbat 10a), "Rava bar R. Huna would put on beautiful clothes and pray, saying, 'Beautify yourself before your God, Israel (Amos 4:12).' " And in relation to "the fine clothes of her son Esau" (Genesis 27:15), R. Shimon ben Gamliel said (Bereshit Rabbah 65:16), "I served my father ... but when Esau served his father, he wore only regal garments." If a creature of flesh and blood is served in this manner, how much more so should one take care to be dressed respectfully when he stands to pray before the King of Kings, the Holy One Blessed be He, and to sit before Him as one sits before a great king.
In this paragraph, we see a suggestion that nice clothing is important for both praying as well as otherwise. It is interesting to note that the example for non-praying situations is taken from Esav's example. (AFAIK, he was not a "davener".)
BTW, there seem to be more sources that concentrate on the need to look tidy on Shabbat and Yom Tov, but there is different reasoning for that.