The Liturgy already teaches
Before the homily, the Church has heard multiple readings. After the homily, the Church confesses the Creed and continues toward the Eucharistic prayers. The homily helps interpret the Word of God, then the service continues in prayer and sacrament.
Let the word of Christ dwell in you richly in all wisdom, teaching and admonishing one another in psalms and hymns and spiritual songs.
The whole Liturgy is catechetical. The readings teach, the Creed teaches, the litanies teach intercession, the Anaphora teaches thanksgiving, and Communion teaches union with Christ. A shorter homily can still be faithful when it serves the appointed readings and leads the people back into worship.
Where longer teaching belongs
Longer teaching often belongs in catechism, Bible study, Sunday school, spiritual meetings, or pastoral conversation. The Liturgy gives the Church her central worship, while those settings give more room for extended explanation, questions, and formation.
The homily should therefore be received as one part of the Liturgy of the Word. Its purpose is to open the Scriptures, call the faithful to repentance, and prepare the people to continue toward the Eucharistic offering.