"When they had come to Capernaum, those who received the temple tax came to Peter and said, 'Does your Teacher not pay the temple tax?' He said, 'Yes.' And when he had come into the house, Jesus anticipated him, saying, 'What do you think, Simon? From whom do the kings of the earth take customs or taxes, from their sons or from strangers?' Peter said to Him, 'From strangers.' Jesus said to him, 'Then the sons are free. Nevertheless, lest we offend them, go to the sea, cast in a hook, and take the fish that comes up first. And when you have opened its mouth, you will find a piece of money; take that and give it to them for Me and you.' (Matt. 17:24-27).
The law of Moses required that every male that was at least twenty years old pay a tax of half a shekel for the support of the tabernacle (cf. Exo. 30:12-16). This tax was later collected annually for the temple (cf. II Chr. 24:5,6).
Peter was asked - "Does your Teacher not pay the temple tax?" (Matt. 17:24). This question was presented while they were in Capernaum, which is reasonable since that was the city Jesus could most accurately call His home. Peter responded affirmatively, indicating that Jesus did (and would) pay the tax.
When Peter came to Jesus, Jesus spoke first, before Peter even had a chance to mention anything about the tax (cf. John 2:25) - "From whom do the kings of the earth take customs or taxes, from their sons or from strangers?" Peter correctly answered the question and Jesus stated this logical conclusion - "Then the sons are free."
In this context, "strangers" does not mean "foreigners"; it means those who are not a part of the king's family. When taxes were collected, the king did not collect from his immediate family but from the citizens of his kingdom. Jesus' point here is this: Since the sons of kings are free from the payment of taxes, I, the Son of God, am exempt or free from God's taxes (cf. Exo. 30:13).
In spite of the fact that Jesus had the right to exempt Himself from this tax, He would not exercise that right! He doesn't want to be misunderstood as advocating that men shouldn't pay this tribute to God. Jesus had no intention of stirring up problems just so He could exercise His rights. It is true that Peter would understand His reasoning as would some of His disciples, but the tax collectors and other Jews would not.
Jesus gave Peter explicit instructions regarding how he was to get the money to pay this tax. The miracle involved in paying the tax in this manner clearly shows that the whole realm of nature is subject to Jesus and that He was indeed the Son of the King.
Dear friends, Jesus' attitude here should be imitated and carefully considered by those who insist upon exercising their freedoms in Christ to the detriment of others. Jesus could have stood firm for His rights and said, "I am not going to pay because I should not have to pay as the Son of God!" But, He was more interested in His impression and influence upon others, rather than exercising His rights. He gave up His liberty in order to prevent offending others. His selfless behavior here shouldn't surprise us. After all, he gave up the glory of heaven to be born of a virgin and be brutalized by His own creation--for the good of the world! Christians today should always be eager to give up their "rights" for the sake of others (cf. Rom. 14:1-15:3). We should be glad to do this and not comply in a begrudging fashion. Of course, it must be clearly understood that it is never right to compromise doctrine or practice error in order to prevent offending others. But, in matters of indifference, we must be flexible and follow Jesus' lead.