When all the people heard this, and the tax collectors too, they justified God, having been baptized with the baptism of John, but the Pharisees and the lawyers rejected the purpose of God for themselves, not having been baptized by him.There's a lot of things I could say about this comment. But for now notice how Luke describes the people's response to Jesus' words. They "justified God" (Greek: edikaiosan ton theon).
What are the implications of this statement? First, the people declare God "just" or "righteous" (Greek: dike) when they hear Jesus commend John even though John expressed some doubts about Jesus. Those that had been baptized by John recognized this as a vindication/justification of John's ministry.
Second, by declaring God "righteous" the people are extolling God's faithfulness. To say that God is "righteous" means that he is faithful to his promises and covenant. It's not first of all a scary thing, as in God's absolute moral perfection over against our sin. Rather, it's about God being true to his purposes. In fact, the parallel comment with reference to the Pharisees has them "rejecting the purpose of God for themselves." So to "justify God" means that one aligns oneself with the purposes of God. If one has been baptized, then one is a member of those who "justify God" and submit to his purpose and plan.
Third, that Luke should be concerned with the "justification of God" should not be surprising to us. Remember, Doctor Luke is the apostle Paul’s assistant. He writes this Gospel account to ground Paul’s teaching ministry about Jesus. Justifying God is a major theme in Paul's ministry. God must be "justified" to the Jews and Gentiles alike so that they can align themselves by faith with the present purpose of God in Christ.
Remember the theme of Paul's great letter to the Romans. It's not primarily about our justification. The letter is about "the justification of God." The letter starts off with Paul giving the theme: The righteousness of God is revealed in the Gospel (1:17). Paul does not mean "righteousness from God," but rather, he is going to explain how the history of God's work in Jesus manifests God's own righteousness. In other words, God has been faithful and true to his covenant. The coming and work of Jesus is proof. That's the theme Romans. The righteousness of God. It shouldn't surprise us, then, that Dr. Luke has the same concerns. Through Jesus God's work of grace to Jews and Gentiles alike proves his "righteousness." Those who are baptized and join the new community of Jesus' disciples thereby align themselves with the purpose of God and justify God publicly.