God's Word Always Achieves its Purpose
Nothing that God says is ever wrong. There is a purpose behind every word, and the words stand until they have done their job. For instance, sexuality and marriage is only for this earthly life: in heaven there will be no married or sexual relationships (Matthew 22:30), and so God's instructions about such relationships only last for this life. Likewise all the laws designed to restrain sinful behaviour will be unnecessary in heaven which is a sin-free city!
Other instructions also had time limits. God's laws about animal sacrifices all looked forwards to Jesus being the ultimate sacrifice: after His death, no other sacrifice would ever be necessary (Hebrews 9:25-28). The laws which held Israel together as God's people (specific instructions about food, Sabbath, purification and land use) had done their job by the time that Gentiles who believed in Jesus were welcomed into His kingdom. The law was no longer needed but many of the principles behind those rules remain as godly wisdom.
It is those principles for righteous relationships, with other people and with God, which Jesus exposed in the Sermon on the Mount. He saw behind the act of murder to a heart of anger, behind the religious activities of prayer and fasting to a heart of pride. And so, although Jesus appeared to be dismissing the significance of keeping a religious rule, He was really emphasising the importance of having the right heart and being the right person before God.
It has become popular for some preachers to say that Biblical standards of morality and relationship do not matter anymore because our civilisations have become more enlightened. They are in error, because only Jesus knows when God's Word has done its job; nobody else had the right to declare God's Word fulfilled. Jesus explained to the trainee apostles the truth which they had to proclaim in the Last Days (the time up until His return). In the same way, we must also stay true to God's Word, as Jesus explained it, speaking with gospel compassion and looking to all of its fulfilment when we meet Jesus face to face. Many people would like us to change the message to make it suit the purpose of our society: we must not do that. God's Word is designed to achieve His salvation purposes in our lives and in our communities. Let us not change it, but love it, do it, share it and thank God for it.