How do you reconcile the two different accounts of the census of men in Israel that David took in 2 samuel 24:1 and 1 chronicles 21:3? one text says that God told him to do it and the other Satan? which was it?
And what on earth is the purpose of the book of chronicles?
One way to reconcile the two accounts is to say that God sometimes uses Satan to accomplish his purposes. He allowed Satan to take everything away from Job to prove his faith (Job, chapters 1, 2). It could be that he allowed Satan to tempt David into pride. Or it could be that Satan was going to tempt David anyway, and God sat back and let it happen because it accomplished his purpose. Either way, he was going to punish Israel, and either actively or passively allowed David to give him a further reason to do so.
Another reason for the difference may relate to your second question. The books of Chronicles were possibly written by Ezra, and definitely written after Judah had returned from captivity in Babylon. The purpose of the books appears to be to instill pride in Israel again. These were people who were mostly born in Babylon or elsewhere, who had never felt like a separate nation. Now that they have reestablished the nation of Israel, Ezra wanted to give them an account of the good things that had been their heritage. Thus the books of the Chronicles deal mostly with the positive accomplishments and leave out a lot of the negative things found in the books of Samuel and Kings. It is not lying, but it is selective propaganda. So, when the author did have to relate a negative incident, such as the census and plague, he puts the best possible face on it. Thus he attributes the idea for the census to Satan, who probably did tempt David, rather than attributing it directly to God as the writer of Samuel did. Itís not a contradictory account, but just looked at from a slightly different viewpoint.