Ezra was prostrating himself and praying “before the house of God” (10:1). Shecaniah admits, “We have been unfaithful to our God” (10:2). It was with God that they made this covenant because they trembled at His commandment (10:3). They needed to confess their sins to the Lord and do His will (10:11).
While sin always hurts other people and we need to ask their forgiveness when we sin against them, sin is first and foremost against God Himself. That is why David, after committing adultery with Bathsheba and having her husband murdered, said, “I have sinned against the Lord” (2 Sam. 12:13). He wrote (Ps. 51:4), “Against You, You only, I have sinned and done what is evil in Your sight.” Certainly David had sinned against Bathsheba and even more so against her husband, Uriah.
But those sins were nothing in comparison with David’s offense against the holy God. When a believer sins, he gives occasion to the enemies of the Lord to blaspheme (2 Sam. 12:14). Unbelievers will mock God and justify their own sins when they hear of a believer’s sin. Thus our sin is primarily against God, which means that our repentance must be primarily toward Him also.