The short answer is because these words are cultismos or learned words.
According to Corominas, espíritu was taken directly from Latin in the 13th century:
DERIV. Espíritu, 1220-50, tom. del lat. spirĭtus, -us, íd.,
therefore it is a cultismo or learned word, and not a palabra patrimonial or natural word. It is a similar story for tribu and ímpetu:
TRIBU, 1490 (y ya alguna vez en el S. XIII). Tom. del lat. tribus...
ÍMPETU 'empuje', med. S. XV. Tom. del lat. ĭmpĕtus, -us...
For these cultismos, taken directly from Latin or Greek, the rules of natural language evolution do not apply, because there has not been continuous use from Latin to romance. Sometimes some of the basic rules apply to these words, like in the case of spiritus, where it loses the final -s, sometimes none. And sometimes these words change in their subsequent history as the language continues evolving.
There are some interesting examples in which two different words have the same origin, one being the natural evolution directly from Latin, the other being a later acquisition or cultismo. For instance:
- operam > obra (patrominal) or ópera (cultismo)
- laborare > labrar (patrominal) or laboral (cultismo)
A good introductory reading for these subjects is this article (in Spanish).