From the previous lessons: time, di connotes the idea that the behavior happens habitually.
Di mattina = in the mornings.
Prepositions are usually idiomatic. Using 'a' in temporal terms is seen usually with months, parts of the day and naming times.
E.g.: Ad ottobre, a mezzogiorno, alle otto.
Hope things cleared up for you. ✨