There are several reasons the F-117A is being retired, but must of these relate to maintenance.
Although based on HAVE BLUE and other stealth programmes the actual development schedule for the F-117A was 31months from the contract being signed to first.
As only a small number of aircraft were to be built, many components from other aircraft were used (many Lockheed items F-104 Starfighter etc). Not only mechanical items (wheels), but parts or whole electronic systems were borrowed from other aircraft (or in a couple of cases cancelled projects). Now that these older platforms are no longer in service the F-117A has a very big obsolescence problem. If a part is worn out or breaks and there are no spares available, and nobody makes the part any more what can you do? There ways of managing obsolescence. Buy additional spares when you have the chance “life of type buys”, re-design etc. The current operational is gradually reducing and the non-operational aircraft are being stripped for spares, to keep the rest of the fleet flying.