Tar attracts dirt because fresh or warm tar can stay tacky, and its dark oily surface holds dust, fibres, grit, pollen, and small debris.
Dirt sticks to tar for the same reason tar sticks to many surfaces. It is adhesive, slightly mobile, and often slow to settle. A freshly tarred object left outdoors can collect dust, seeds, insects, and fibres before the surface has become stable.
Warm weather increases the problem. Sun can soften the top layer and make an old coating tacky again. Wind then brings grit and organic matter, which become embedded in the surface rather than sitting loosely on top.
Texture matters as well. Rough timber, rope, and old cracked coatings have many places for dirt to lodge. Once dirt is held in the tar, rain may not wash it away evenly. Some areas become cleaner, while others become darker, greasier, or grey with dust.
Dirt attraction is not always failure. It is part of how tarred working materials age. It becomes a problem when dirt prevents bonding between coats, holds moisture against the surface, or makes the coating unsuitable for handling.