Because, as J. Gresham Machen said so well, Christianity is not just — or chiefly — an ethical code, but rather “a way of life founded on a message.”
Christianity is based on news. On something outside of us. On truth. And that’s theology.
Since Christianity is a way of life founded on a message, you can’t uphold the way of life if you disconnect it from the message. It’s like cutting a plant from its roots. It won’t last.
Further, Titus 3:8 shows us that sound doctrine (with exhortation) leads obedience when it is understood and believed. Note how Paul tells Titus there to teach the doctrine of justification so that God’s people will excel in good works.
How is theology the foundation of obedience? Because it builds the joy and hope that fuel obedience. Theology builds faith, and faith fuels obedience. The Christian life is a life of faith, and therefore doctrine is essential.
Of course it is not enough to just hear truth. We also must believe it and act on it. In turn, as we do so we find that application yields more spiritual discoveries.
So, interestingly, if you care about theology, applying what you learn leads to both love and, in turn, greater theological insight. But the ultimate aim of it all is love (1 Timothy 1:5).