Well the Air Force designated it a fighter because the pilot (aims) the ordnance just like a gun in the nose or on wings. It carried a grand total of two laser-guided bombs because it was too small for anything more. They were dropped far from the target and guided by the pilot to the target.
The B-2 Bomber carries 20 tons of conventional or nuclear bombs which are dropped straight out the bottom where gravity takes over. Hence a (bomber).
B-2 Spirit Bomber
Lockheed Martin · F-117 Nighthawk
Some planes are given the F designation to draw interest; top pilots looking at "new" aircraft are going to want to fly fighters more than bombers and those much more than cargo and tankers.
The answers kind of vague... F-117's "F" was given because it was classed as air to ground attack, like F-111, A-6, A-10, etc...
The operational aircraft had the official designation of "F-117A". Most modern U.S. military aircraft use post-1962 designations in which the designation "F" is usually an air-to-air fighter, "B" is usually a bomber, "A" is usually a ground-attack aircraft, etc. (Examples include the F-15, the B-2, and the A-6.) The F-117 is primarily a ground-attack aircraft so its "F" designation is inconsistent with the DoD system, but it is an inconsistency that has been repeatedly employed by the U.S. Air Force with several of its ground attack aircraft since the late 1950s, including the Republic F-105 Thunderchief and General Dynamics F-111 Aardvark.