To the Editor:

At his Feb. 22 news conference, President Reagan tried to justify U.S. shelling in Lebanon as a reaction to attacks on our embassy: ''It was because of shelling our embassy. Now that's United States territory.''

As a matter of international law, an embassy is not ''territory'' of the sending state; it is territory of the receiving state that is accorded, through various treaties and customs, some immunities from host- country law.

Defense of an embassy is the responsibility of the host state, not the sending state. The Marine guard at U.S. embassies is stationed there with host-country permission to handle minor incidents; it cannot legally be used to fight a war as if an international police force.

If the host country cannot or will not perform its duty to protect the embassy, the sending state has recourse via diplomatic claims, reciprocal restrictions on the other state's embassy or even cutting diplomatic relations, leaving communication to other channels, such as the two countries' representatives at the United Nations.