The Navy didn't target the civilian airliner -- it targeted a drone that was supposed to simulate an aircraft (this may explain why the eyewitness accounts of a projectile are not consistent -- it appears that different witnesses may have seen different projectiles).
The aircraft was supposed to be flying through the area at an altitude of 19,000 or so, which is consistent with any eastbound trans-Atlantic flights out of JFK Airport. However, in the case of Flight 800 there was one difference -- the airliner was ordered to fly through the area at an altitude of 13,000 feet to make way for a northbound US Air flight that was landing in Providence, Rhode Island behind schedule.
The theory is that the Navy fired the missile because the plane was not supposed to be there -- the missile locked onto the aircraft instead of the drone by mistake.