He wanted to dig out the city which was claimed by the desert via sandstorms. Evidence Bayek finds points that the city was an offering to Sekhmet long ago so that she wouldn't destroy other cities or something like that. Thus, Scarab was a blasphemer going against Sekhmet's decision. That's why bad things kept happening in the city supposedly as the writings in the unearthed houses pointed out. The city was cursed.