>>120353472He didn't pitch a Superman movie, Warner needed to make a movie ASAP or else the Shuster and Siegel estates could sue them thanks to a court ruling regarding movie royalties. Multiple directors were approached and they declined. Snyder said yes.
Even though he didn't like Superman it was still a well paying job blockbuster fresh off the financial and critical success of The Dark Knight, and it's not like Snyder has literally ever directed a movie that wasn't an existing IP anyway either before or since so it's not like he had any other ideas. It's not surprising he took it.