Let's beging with the closer inspection of the question. The conflict between Teutonic Order and Polish duchies and later Kingdom of Poland is nothing out of ordinary, as virtually every conflict of established polities in medieval Europe meant hostilities between Christian, usually Catholic powers. Thus, the conflict between Teutonic Order and Poland was not really different than the Hundred Years War, German-Polish War of 1109 or the War of Scottish Independence. On the other hand, the question posed might also be interpreted as one asking why the Teutonic Order entered a prolonged conflict with Poland what seemed to be contradicting its official mission that was the Christianization of the Baltic area inhabited by pagan Prussians. And as this issue is definitely not obvious, I will focus on it in the following answer.
Order leaders also realized that their position in the Holy Land is precarious and being associated with a specific political power in Europe, they decided that the next logical step in the development of their power is to secure a land they could use as its rulers, not vassals of any other local power. They attempted it at first in Hungary, arriving in 1212 to Burzenland (now in central Romania) at the behest of king Andras II who was persuaded to do so by his wife, Gertrude of Meran (what could have been also a factor in the assassination of the latter shortly after). In 1224, the Order attempted to break the feudal relation with Hungarian king and create their own, independent state from the lands they were granted, but this move immediately antagonized the Hungarian nobility, clergy and king himself who exiled the Teutonic knights from his realm.
This did not disheartened the Order though, and its leaders trained their sights on Poland that has been politically divided between several lines of the local dukes governing their provinces as per the last will of the king Boleslaw III who died in 1138. Although they were nominally obliged to heed the call of the ruler of the 'duke senior' governing the senioral province, such division severely fractured and weakened the country. Thus, the Grandmaster Herman von Salza offered his help to the duke Konrad of Masovia whose lands bordered with the territory inhabited by various Prussian nations. Prussians were often invading Masovia leading to regular border conflicts that, although not very serious, were still undermining the wealth and stability of the province. Polish dukes under the auspices of the Pope Honorius III were attempting to bring the Christianity to Prussia, but their efforts were very limited.
Thus, Konrad of Masovia eventually agreed to Grandmaster's proposition and invited the Order into his lands in 1226, granting them lands of Chełmno and Michałów as feudal fief with Order as Konrad's vassals. The Order quickly followed with establishing its military presence and persuaded the Order of Dobrzyn Brothers to join their ranks, taking over the land of Dobrzyn and merging it with their fief without earlier consultation with Konrad, still a nominal owner of this area. Furthermore, they also negotiated the cooperation of a margrave Henry of Meissen, who invaded the capital Masovia. These two events heavily strained the relations between Teutonic Order and the Masovian duke who, much like Hungarian king Andras II, revoked the beneficium, taking back his lands from the Order. But this time, Order leaders were better prepared and secured the support of the Pope Gregory IX and Holy Roman Emperor Frederick II who, taking the falsified documents presented by the Order (so-called Kruszwica Falsificate) issued documents stating that the land of Chełmno and Michałów were granted to Order not as a feudal fief but as the permanent donation with Order as its sovereign ruler. The Imperial bull, issued in 1235 but bearing the date of 1226 was an obvious lie, but it was a lie backed by the authority of an Emperor and a papal support. This document allowed the Order to regain the lands of Chełmno and Michałów.
The expansion into Prussian land was very energetic and in the first 20 years, Teutonic Order managed to conquer all Prussian territories up to the Pasłęka River and quickly colonized it with settlers from German states, Polish duchies and Bohemia. This stage of campaign was followed by the joint operatin of Bohemian king Ottokar II and Teutonic Order than resulted in the conquest of Sambian lands. In 1260, however, the Prussians united under Herks Mants and almost managed to break the power of the Order, although due to the support of German nobility and Pope, the Order finally prevailed. The fall of the Mants' uprising marked the end Prussian conquest.
The relationships between Order and Polish rulers were relatively neutral, with the exception of relatively strained situation with Masovian rulers, but they were generally devoid of hostilities. This changed in early 14th century. In 1308, Brandenburg decided to seize Pomerelia, assuming that the weakened and divided Poland won't be able to take it back. Duke Władysław I, future king of Poland was forced to ask Teutonic Order for help. Knights obliged and thwarted the Brandenburgian invasion but then named their price that exceeded the worth of Pomerelia. Władysław I refused to pay (it is also estimated that he was unable to do so even if he wanted to) prompting the Order to simply take the Pomerelia for themselves.
Early 14th century was not a good time for militant orders. The loss of Holy Land and Kingdom of Jerusalem, as well as failures of the last crusades resulted in growing criticism towards them that soon was accompanied by allegation of fraud and other misdeeds. In addition, their vast influence started to be considered a potential threat to the existing status quo, as the Teutonic Order effectively created its monastic state in Prussia, Knights Hospitaller did it in Rhodes and Knights Templar seemed to consider following suit. Such atmosphere of hostlity was used by Philip IV to arrest many high-ranking Templars in 1307 and exert pressure on Pope Clement V to call other monarchs to arrest Templars and seize their property. This could have spelled doom also for the Teutonic Order, as Polish and Lithuanian rulers, as well as the Livonian bishops were frequently expressing their complaints regarding unjust actions of the Order. In 1305 Frederick, archbishop of Riga, wrote to Pope stating that Order 'openly attacks and kills Christians in Livonia to seize their land and if Holy See won't end this, the entire Christian realm in Livonia might fall as it did in Holy Land'. This was a grave allegation that could have even led to the dissolution of the Order, especially that there were virtually no pagans in the area at that time (Great Duchy of Lithuania, being largely formed of Ruthenian principalities was predominantly Eastern Orthodox and Grand Duke Giedyminas had amiable relations with the papacy, declaring readiness to accept baptism himself and striving to establish the Orthodox Lithuanian metropoly. Francisco de Moliano, papal legate, even managed to excommunicate the brothers of the Order but the political maneuvering of the Order that had strong diplomatic influence in papal court. In addition, unlike Knight Templar, Teutonic Order had a strong, centralized military presence and were able to defend if necessary. Last but not least, influence of their main opponents, i.e. archbishop of Riga and Władysław I was nowhere close to the one held by king of France. In addition, Polish duke and future king strained his relations by taking military action by Order, what was portrayed by the Teutonic diplomats as siding with pagans and by arresting his political opponent, archbishop Jan Muskata. Thus, Teutonic Order came unscathed thanks to good diplomacy, Imperial support and relative weakness of their potential adversaries. This also was a obvious sign that the Order will use all available means to solidify their hold over the Baltic area.