Abu Hurairah (May Allah be pleased with him) said: The Messenger of Allah ﷺ said, "Angels do not accompany the travellers who have with them a dog or a bell". Muslim.
The Prophet Muhammad ﷺ was teaching his followers to take responsibility for their own spiritual wellbeing and ensure that nothing stands in the way of their connection with God's divine grace through His messengers - the angels. By leaving behind any items such as dogs or bells which could potentially disrupt this connection, one can ensure that they are able to benefit from angelic guidance during their travels.