Just to complement Geerkens' answer. Portugal had the Order of Christ. Originally the Portuguese Templars, they were incorporated in a new order when the Templars were suppressed.
With the end of the reconquista and loss of relevance of the crusades, the Order progressively lost its warrior-monk nature. In the end of the c. XV, its lay members did not have to be monks, celibate, or have military training anymore, and in 1417 Prince Henry the Navigator had become the Grand Master. It become in a sense just another knightly order mastered by the royal family.
But one that still had extensive land revenue, noble and clerical members. And this revenue was bound to be used for the propagation of the faith, charity, and the defense of the kingdom against infidels, even if there were no more Muslim states in Western Iberia. (So the king could not just pocket the money without losing face)
The order could have evolved into another charitable organization, or the kings could have grabbed everything and dared the other nobles in the order to oppose them.
But they decided to focus on navigation, early in c. XV. Obviously it is easy to imagine 'is there a direct route to India?" - but the point is that discovering Africa was a nice objective by itself. They knew that Morocco had extensive southern trade via Saharan caravans, even because they had taken Ceuta in 1415 and could trade themselves at the end of this route. Not only the names Ivory Coast and Gold Coast were not misnomers, but also the Portuguese were already expecting to find those goods there.
They would have less expenses trading by ship than the Moroccans had trading by desert caravans - so they had good hopes of dominating the trade with good profits even without conquering the whole African hinterland.
Moreover, their trade would (and did) hurt Morocco and Algiers (Saharan caravans become much less important after the age of discoveries). The reconquista had still not finished (Granada was still there), and they still feared an Muslim reversal of the reconquista (why not? Some jihadists like the Almoravids could not rise again? besides that, the Barbary pirates were always active)
It is very easy to justify the navigations as defense of the kingdom and propagation of the faith in this context. In 1460, a 5 percent levy on all merchandise from new African lands were already going to the Order, besides, even before, of other taxes and the "quinto" (20% of profits) due to Henry or the order as the sponsors. They paid for much of the great discoveries and the red cross in the sails is their symbol, not a Portuguese one. The order church at Tomar was the first ecclesiastical jurisdiction to cover Brazil - not long afterwards Lisbon Diocese took over.
After reaching Ivory Coast and exploring southern currents (Volta do Mar), it looked that it was possible to continue south... Reaching India could be more than a pipe dream after all? The African profits were attracting more resources and people? Nice. Morocco and Algiers are getting poorer? Nice too.
When East Mediterranean routes become even less reliable after the loss of Constantinople, Asian products become even more valuable, and the Ottomans become more dangerous, this could only increase their resolve.
But they already had their reasons, the resolve and steady organizational financing for it well before the fall of Constantinople, when African (done) and Asian (potential) trades were already valuable enough to justify the effort.