Which one is it? Did God make David take the census or, was it Satan? There’s no contradiction. Only one of them went against David to cause him to sin against the Lord. The first thing we must look at is, can God tempt you to sin?
My Jewish friends, the Messiah, had to come to deal with our sins first. How can a person with sin enter into heaven?