HOW IS IT that the United States and Israel have had such trouble in doing the seemingly simple task of drawing a line through a field in Beirut so that Israeli occupying forces and American Marine peacekeepers will not collide? In an especially nasty and dangerous incident last Wednesday --not the first, as President Reagan himself noted yesterday--things actually got to the point where an American captain, attempting to enforce his understanding of where the line lies, said to an Israeli tank commander that if he wanted to pass, "You will have to kill me." The incident ended without violence, but it left a disturbing sense of confrontation between forces and countries that are friends.

No one familiar with the ways of the Israeli army can doubt that Israeli troops, who continue to take casualties, are patrolling aggressively, that they are notoriously suspicious of outside peacekeepers in Lebanon and that Defense Minister Ariel Sharon may have his own reasons to act tough toward the Americans. He embodies the strain of Israeli thought--one that simmers just beneath the surface of official policy--that wants to do these things: push the Lebanon negotiations to collapse; deal with the Maronite Christians rather than the Lebanese government and informally partition Lebanon with Syria. The hope is probably to finesse the even harsher Israeli-American confrontation over the Palestinian question that is coming one of these days.

Whether the Sharon idea serves the Israeli interest is for Israelis--perhaps soon, in an election--to say. But the Sharon policy runs completely counter to the American interest, and there is good reason for Americans to be on guard against it. The question is, however, whether the approach taken by Secretary of Defense Caspar Weinberger is the best way to proceed. For Mr. Weinberger, like his Israeli counterpart, seems also to have inclinations that are inconsistent to some degree with the stated policy of his government. We are setting aside here the repeated evidence of personal bad feeling between the two men.

While President Reagan pronounces Israel a strategic ally, the secretary has not concealed his judgment that Israel is a strategic and political liability. He often takes occasions, as he did over the incident in the Beirut field last Wednesday, to dramatize differences between the United States and Israel. It seems fair to ask whether his orders to the Marines in Beirut not to talk to Israeli soldiers may not have contributed to the friction. In Lebanon, Mr. Weinberger keeps pushing not only for an early withdrawal of Israeli forces but also for an early withdrawal of American and other peacekeepers. Apparently realizing that this happens to be the sure recipe for Lebanon's quick collapse into anarchy, Mr. Reagan said yesterday he was setting no time limit on the Marines' stay.

There is no reason why relations between the United States and Israel, given their major policy differences, have to be sweet and smooth. Precisely because of the importance and unavoidability of these differences, however, the two countries should be paying extra attention to the process of their relations. We think it would make sense for the United States to play it straight in its policy and to avoid a Mr. Good Guy/Mr. Bad Guy approach that is bound to play into the hands of Israeli hawks like Ariel Sharon. The United States is insisting, as it must, that Israel do some very difficult things, first in Lebanon and then with respect to the Palestinians. The administration only complicates this essential effort by having one of its top officials convey the impression of animosity Mr. Weinberger does.