I completed that bloodbath quest by killing all the Dunmer and got a bounty of over 5000, so I Divine Interventioned back the Moonmoth and ran to the quest-giver because he eliminates the bounty. The Legion was still chasing me when I talked to him, though. I'm also part of House Telvanni, the Tribunal Temple and the Ashlanders, which lowers disposition among the Imperial Legion, and the only faction with a positive modifier I'm part of is the Mages Guild.
So are they attacking me because of a bug involving that bloodbath quest, or because I'm part of too many of their enemy factions?