When a man is affected by a passion, things seem to him greater or smaller than they really are, as to a lover, what he loves seems better, and to him who fears, what he fears seems more dreadful. Consequently owing to the defect of right judgment, every passion, considered in itself, hinders the ability of deliberating well. (Summa Theologiae 44:2).
St. Thomas thus argues that while fear inclines us to think about how to avoid the thing or danger we are afraid of, it has the tendency to distort our judgment of the matter. From this it might seem to follow that it would be ideal never to feel fear, that we would thus act most reasonably and humanly. Thomas does not, however, draw this consequence, but affirms the value of fear for human, rational action.
If fear is moderate, not disturbing the reason very much, it conduces to acting well, insofar as it causes a certain solicitude, and makes a man deliberate and act with greater attention. If, however, fear increases so much as to disturb the reason, it hinders action even on the part of the soul. (Summa Theologiae 44:4)
In this passage Aquinas grants the point he made above, that even moderate fear has a certain tendency to incline our judgment to it, and in this way to make our judgment less objective. But when fear is moderate, and when it is directed to something that is a real danger, a real possible evil, then the benefits outweigh the harm.
In general the effect of such emotions, which is to make us focus on certain aspects of what is before us, and to judge them accordingly, has potential benefits and potential risks: (1a) Though an emotion such as fear may make us overestimate the fearfulness of an evil, (1b) if we would otherwise have underestimated it, then it brings our estimation closer to the truth; again, (2a) though the emotion may make us overlook certain things, (2b) it may also bring certain things to our attention, which we would otherwise not have given attention to.
In the larger picture, the largest factor determining whether passions and emotions are beneficial or detrimental for truly human action, is the formation of the emotions, which takes place through the acquisition of virtue. When an emotion itself is a formed and reasonable passion, the overall effect is almost always good.
A note on Aquinas's use of scripture here: In the Sed Contra of 44:4 he cites St. Paul, "With fear and trembling work out your salvation" (Phil 2:12), and remarks in the body of the article that though excessive fear hinders us from acting well, St. Paul is not speaking of this kind of fear. This seems to be an indication that Aquinas is not simply using St. Paul as a "proof text" for an opinion he gets from, say, Aristotle, but sees a real and significant doctrine on the role of emotions in Christian life in the Sacred Scriptures, though of course, in this systematic work, he does not go into all detail of exegetical questions.