"For many the purpose of the church is to make sure that Christians become more and more obedient. Early on, that's the one that stuck with me - we attended church so that we would make fewer mistakes this week than we did last week." - Tom Mercer, Oikos: 8 to 15
Going to church to become more obedient would be like joining the army to get into shape. In both cases we have completely missed the mission. Do we as Christians need to learn to be more obedient? Yes. Should we be attempting to make fewer mistakes this week than we did last week? Yes. Is that our goal. No.
God has given us a mission, and obedience is what helps us complete it. We must learn to keep the main thing the main thing and focus on it until it drives everything we do. Why did Jesus come? To seek and save the lost (Luke 19:10) and what was his command to us, make disciples and teach them to obey Christ (Matthew 28:19-20). Why teach them to obey? So they can accomplish the mission. What is the mission? Make Disciples. How did Jesus model this for us? By coming to seek and save the lost.
We need to go out into the world, find the lost and point them to Christ. Teaching them to obey him so they too have the ability to complete the primary mission, to seek and save the lost.
A well behaved church, with no desire to share the gospel, is like a strong and fit army that is not willing to fight in the battle, they are both useless.