While they try to reduce it as best they can its often low on the list,
According to this article
The SR-71 was designed to minimize its radar cross-section, an early attempt at stealth design.[21] Finished aircraft were painted a dark blue, almost black, to increase the emission of internal heat
One of the problems you get at is that airframes heat up at high speeds. In the case of the blackbird it was fast enough (and could fly high enough) to outrun anything anyway so heat signature was less of a concern.
According to this article
In the B-2, all of the exhaust passes through cooling vents before flowing out of the rear ports
So it seems they cool the exhaust. Im not sure what effects this has on the over all thrust that the plane generates but Im sure it has an effect in some way.
The article also goes on to talk about the exhaust placement and how top mounted exhaust can help with ground based sensing that is looking up at the bottom of the craft
Putting the exhaust ports on the top of the plane further reduces the infrared signature, since enemy sensors would most likely scan below the plane.
Reducing heat signature has 2 main functions. To keep the plane from showing up on ground based heat sensing systems and to keep thermal guided weapons from locking on. For what its worth the SR-71 was able to outrun most missiles of the time, some 4000 by all accounts.
For what its worth:
the SR-71 design did not take into account the extremely hot engine exhaust and the particles in the hot exhaust reflect radar extremely well. Ironically, the SR-71 was one of the largest targets on the FAA (Federal Aviation Administration) long range radars, which were able to track the plane at several hundred miles
So arguably the greatest spy plane of all time was not even that stealthy...
In regards to the F-117
exhaust was channeled through long narrow ducts lined with heat-absorbing material so that it was cooler by the time it exited the plane and therefore did not show up as well on heat detectors
Seems similar to the system employed on the B2