All praise to Allah Subhanahu wa Ta'la and blessings of him be on Prophet Muhammad peace be upon him His family and companions.
أَنَّ النَّبِيَّ صلى الله عليه وسلم قَالَ " إِذَا رَأَيْتُمْ
هِلاَلَ ذِي الْحِجَّةِ وَأَرَادَ أَحَدُكُمْ أَنْ يُضَحِّيَ
فَلْيُمْسِكْ عَنْ شَعْرِهِ وَأَظْفَارِهِ " .
Umm Salama reported (these words) directly from Allah's Messenger (ﷺ):
If anyone has in his possession a sacrificial animal to offer as a sacrifice (on 'Id al-Adha), he should not get his hair cut and nails
trimmed after he has entered the first days of Dhu'l Hijja.(Sahih
In Hanafi Madhab it is Mustahab (Preferable) not to remove hairs and nails during these days for one who is intending to sacrifice, It would not be a sin or invalidates his sacrifice if he removes but would not get those rewards for leaving this mustahab act.
If someone is due to remove unwanted hairs which should get trimmed after 40 days as leaving the unwanted hairs and nails longer than 40 days is Makruh Tahrimi and the Mustahab which would lead to Haram is not Mustahab anymore so in that case he should remove,doing so would not invalidate his sacrifice.
It was narrated from 'Abdullah bin 'Amr bin al-As that the Messenger of Allah said to a man:
"I have been instructed to take the Day of Sacrifice as an 'Id which Allah, the Might and Sublime, has ordained for this Ummah." The man said: "What do you think if I cannot find anything but a female sheep that has been loaned to me so that I may benefit from its milk - should I sacrifice it?" He said: "No. Rather cut something from your hair and your nails, trim your mustache and shave your pubic hairs, and you will have a complete reward with Allah, the Might and Sublime, as if you had offered the sacrifice."(Sunan An Nasai)
Some Scholars have mentioned that this act is also in resemblance with the pilgrims of Hajj and in aspects of cleanliness which you mentioned so Pilgrims covered with dust ,tears and sweat on Mount Arafat are not disliked due to their condition rather beloved to Allah Subhanahu wa ta'la because they are doing this ritual to please their Lord.We may get these rewards too by following that, Prophet Muhammad peace be upon him said
“There is no day more venerable to Allah than the Day of Arafah. Allah's mercy descends to the Heavens of the earth and exalts the people of the earth to the inhabitants of the Heavens. He says: ‘Look at my servants disshelved, dustied, and fatigued. They have come from every far off corner of the earth. They have not witnessed my mercy and they have not witnessed my punishment. And I do not see a day in which more people are saved from the Hellfire than the Day of Arafah.’” [Majma' al-Zawa'id, Vol. 3, Page 253]
Most importantly whatever Prophet Muhammad (ﷺ) has asked us to do we should follow as it has rewards for us and Allah Ta'la says in Quran 59:7
"....And whatever the Messenger has given you - take; and what he has forbidden you - refrain from. And fear Allah ; indeed, Allah is
severe in penalty.(Quran 59:7)
and Allah Swt and His Messenger knows best.