Nearly 2,000 men and women have been prevented from joining the military after testing positive for exposure to the AIDS virus, officials reported. Another 3,900 already on active duty or in the reserves tested positive and have been singled out for medical monitoring and job restrictions. The Pentagon has tested almost 4 million people for the virus over the last two years at a cost of $43.1 million, and testing is expected to cost another $25.5 million this fiscal year. The Defense Department decided in the fall of 1985 to begin testing all recruit applicants as well as all active duty personnel for acquired immune deficiency syndrome. The overall military exposure rate of roughly 1 1/2 cases per 1,000 has changed little since the start of testing. "We are no longer fearful of any significant impact from AIDS on the military," said Julian Barber, an aide to Assistant Defense Secretary William Mayer.