Several factors must have contributed to Tertullian espousing Montanist ideas and reportedly leaving the Catholic Church. But at the outset we should mention that he was not formally condemned as a heretic and recent scholarship even doubts that he actually joined the Montanists, as opposed to defending them and espousing some of their views.
Why Tertulllian Supported the Montanists
First, he lived in Carthage, where Montanism had created a strong revival among Christians. Addressing the Roman governor of the region, he claimed that Christians, certainly including Montanists "have filled every place among you—-cities, islands, fortresses, towns, market-places, the very camp, tribes, companies, palaces, senate, forum; we have left nothing to you but the temples of your gods." (Apologeticus written at Carthage, c. 197.)
Based on the principle that "you shall know them by their fruits" he judged the Montanists in his area to be a godly movement within the church, not a heretical movement sewing division.
Second, he must have been impressed by their charismatic gifts of prophecy and believed them to be legitimately inspired. Thus he wrote:
...after the Bishop of Rome had acknowledged the prophetic gifts of
Montanus, Prisca, and Maximilla, and, in consequence of the
acknowledgment, had bestowed his peace on the churches of Asia and
Phrygia, he [their detractor, Praxeas], by importunately urging false accusations
against the prophets themselves and their churches… compelled him [the Roman bishop] to recall the pacific letter which he had issued, as well as to desist
from his purpose of acknowledging the said gifts. (Against Praxeas ch. 2)
According to the Catholic Encyclopedia Tertullian also wrote a long defense of Montanist prophecy, De ecstasi, in six books. This book was apparently suppressed as it is now lost.
Third, he saw the Montanists' puritanism and spirituality as a cure for the lack of holiness among certain bishops:
The Church, it is true, will forgive sins: but the Church of the
Spirit, by means of a spiritual man; not the Church which consists of
a number of bishops. For the right and arbitrament is the Lord's, not
the servant's; God's Himself, not the priest's. (On Modesty ch. 21)
Finally, Montanism had not been formally condemned in the West so it was possible to espouse support for its New Prophecy and its strict moral standards, without being excommunicated or declared a heretic. The situation was different in the Asian churches, some of which indeed expelled Montanists. See Why the Montanists Were Condemned by David F. Wright for details.
These factors help explain Tertullian's attraction to Montanism, whether he formally joined them or not. In any case, he was not actually declared a heretic and his writings are still included among the most important works of the Western Church Fathers.