4 Then the word of the Lord of hosts came to me, saying, 5 “Say to all the people of the land, and to the priests:
‘When you fasted and mourned in the fifth and seventh months during those seventy years, did you really fast for Me—for Me? 6 When you eat and when you drink, do you not eat and drink for yourselves? 7 Should you not have obeyed the words which the Lord proclaimed through the former prophets when Jerusalem and the cities around it were inhabited and prosperous, and the South and the Lowland were inhabited?’ ”
Zechariah 7:4-7
Here the question is asked by God, “When you were fasting was it for Me?” Were they fasting just because of what they lost or were they fasting because they recognized their sin that caused the loss? God reminds them that when they were obedient and listening to the prophets He sent to them then they were prosperous and in their own land. What can be noted here is that Zephaniah the prophet died with the captives at the hand of the Babylonians yet he was giving the people the word from the Lord.
So sometimes the innocent suffer with the guilty when a land has turned its back on God. The life of a prophet was often difficult in the Old Testament which is often true of all who wish to tell the truth of God’s word among those who reject Him.
God’s answer to them about fasting is that obedience to His word is more important than the fasting. If you do the outward things to appear holy yet you do not obey God, the value is lost.