The State Department has undertaken what is likely to be the biggest embassy-building program in the history of the United States after learning that more than half of the 262 U.S. embassies and other diplomatic posts do not meet minimum security standards established after last September's terrorist bombing of the U.S. Embassy annex in Beirut.

A high-level advisory panel headed by retired admiral Bobby R. Inman, former director of the National Security Agency, reported to Secretary of State George P. Shultz last month that 139 of the overseas posts must be replaced or "significantly overhauled" to meet the new standards.

According to initial State Department estimates, it will cost $3.3 billion to bring these embassies and consulates up to the new standard, including purchase of land and the design, construction and furnishing of many new buildings. About two-thirds of the funds would be needed in the volatile Middle East, officials said.

These sums would be partially offset by the sale of existing U.S. land and buildings no longer suitable for American missions in the age of the terrorist bomb.

One of the most important and most expensive new standards for U.S. embassies is a security zone of at least 100 feet outside major buildings as protection against car and truck bombs such as those that have damaged or destroyed U.S. Embassy buildings in Beirut and other Mideast capitals and a U.S. Marine headquarters compound in Beirut.

Such security zones are almost impossible to arrange in crowded downtown areas, where many U.S. diplomatic buildings have been located for public and official convenience.

Other standards require unusually heavy structures and special construction to withstand explosions and heavy-duty windows and doors that include shatterproof glass.

Inman's group, the Advisory Panel on Overseas Security, was appointed by Shultz last July to advise on security threats overseas in the next 10 years and how to counter them.

A preliminary report was submitted to Shultz Feb. 6, with a final report expected in May. Shultz last Wednesday made the first partial disclosure of the panel's findings to the House Foreign Affairs subcommmitee on international operations.

State Department officials said the truck-bombing of the U.S. Embassy annex in Beirut last Sept. 20, in which two Americans and about 20 Lebanese were killed, was a major spur to the new security standards and large-scale program being undertaken to meet them.

Senate and House committee investigations of the incident were sharply critical of security arrangements and precautions. Some lawmakers also said culpable officials should be held accountable for the failure to install adequate barriers to slow or halt vehicles entering the embassy compound.

Among recommendations of the Inman panel, according to the State Department, is to convene a board of inquiry in the event of terrorist acts to assess accountability for possible security lapses. The State Department investigated responsibility for the Sept. 20 bombing.

No action was taken against U.S. Ambassador Reginald Bartholomew because of recognition that he was dealing with a situation involving many threats. Thinking that kidnaping posed the greatest threat, Bartholomew had set aside most of the spare vehicles for shuttling embassy officials to and from work, rather than blocking access to the embassy building, according to State Department sources.

As the result of an administration request immediately after the bombing, Congress authorized $361 million in supplemental funds to improve security at U.S. missions abroad and diplomatic buildings at home. Only $110 million has been appropriated.

Eleven U.S. Embassy or consular buildings are to be constructed or reconstructed at a cost of $175 million under last fall's supplemental security plan. Another 11 new overseas buildings are to be built at a cost of $139 million under security provisions of the administration's recently submitted budget for fiscal 1986.

In typical recent years, only two or three new embassy buildings have been undertaken.