The purpose of His response may have been two fold. The first purpose was to encourage the disciples to faithfully follow Him. The second purpose and perhaps more importantly, was to teach correct theology.
First-Century Jewish Burial Practices
After a body was placed in a burial cave, it was left to decompose. The family mourned for seven days. This initial mourning period was followed by a less intense 30-day period of mourning, called shloshim. However, the entire mourning period was not fully over until the flesh of the deceased had decomposed, usually about a year later. The Jerusalem Talmud states: When the flesh had wasted away, the bones were collected and placed in chests (ossuaries). On that day (the son) mourned, but the following day he was glad, because his forebears rested from judgment. The final act of mourning, the gathering of the bones into a bone box called an ossuary, was called ossilegium, or secondary burial. According to the Rabbinic sources, the decomposition of the flesh atoned for the sins of the dead person (a kind of purgatory) and the final stage of this process was gathering the bones and placing them in an ossuary (Meyers 1971: 80-85). Jesus confronts this contrary theology. Only faith in Christ's redemptive work on the cross can atone for sin, not rotting flesh or any other work or merit of our own (Heb. 9:22, 26; Acts 4:12; Eph. 2:8, 9). Jesus may have rebuked the disciple rather harshly because they were following the corrupted practice of secondary burial.
The setting of the saying:
The Gospels record two incidents where disciples approached the Lord to request a leave of absence from following Him. The first request is recorded in Matthew 8. Jesus was about to take the Twelve across the Sea of Galilee to the Decapolis city of Gadara. Chronologically, this trip is the first recorded journey of Jesus to minister in Gentile territory. Maybe the disciple hesitated, probably because he did not want to go to those Gentiles so he made an excuse: Let me first go and bury my father.
He most likely appealed to the Jewish burial practice of ossilegium, or secondary burial, which would remove him from following the Lord for up to eleven months. Jesus saw this as an excuse not to minister to the Gentiles. As a result He rebuked him with a statement of irony and challenged the disciple to follow Him. I got most of the information here http://www.ldolphin.org/deaddead.html