The title of Mary as Queen has been a tradition of the Church since at least the fourth century. (Note that Mary is referred to as queen not just of heaven, but also of peace, of the angels, of all Christians, among many other things.) It’s important to understand that the title of Queen is not meant to indicate power over others, but rather to underscore Mary’s relationship to Christ. In other words, because Mary is the mother of Christ the King, it’s logical that she would be called Queen. (A modern example would be the mother of Queen Elizabeth II of England, who was known as the Queen Mother.)
Pope Pius XII affirmed this in his encyclical Ad Caeli Reginam when he wrote, “according to ancient tradition and the sacred liturgy the main principle on which the royal dignity of Mary rests is without doubt her Divine Motherhood.” He also quotes St. Alphonsus Ligouri, who wrote, “Because the virgin Mary was raised to such a lofty dignity as to be the mother of the King of kings, it is deservedly and by every right that the Church has honored her with the title of ‘Queen.’”
Pope Pius explains that Mary also merits the honor of the title because she played such an important role in bringing Christ the Redeemer into the world. “Certainly, in the full and strict meaning of the term, only Jesus Christ, the God-Man, is King; but Mary, too, as Mother of the divine Christ, as His associate in the redemption, in his struggle with His enemies and His final victory over them, has a share, though in a limited and analogous way, in His royal dignity.” Mary’s title of Queen thus doesn’t mean she is on equal footing with God; instead, it reflects how intimately connected she was, and is, to her son and to his mission.