Tokyo — United States government charges that Japanese companies have tried to steal International Business Machines' (IBM) computer secrets could have wide political repercussions.
A Japanese television commentator described the affair, with its spies and FBI undercover agents, as being ''like a bad novel.'' Many Japanese see a deeper potential for damage to bilateral relations, particularly in the area of mutual trust, which has suffered some heavy blows lately.
Japanese trade ministry officials expressed fear that the IBM case - in which Hitachi and Mitsubishi employees allegedly were caught trying to steal IBM computer secrets - could impede resolution of US-Japanese trade problems and slow progress toward improving overall relations.
A senior official declared: ''The Justice Department and the FBI have been working hard to prevent the leak of stategic technology to the Soviet Union and other communist nations. Disclosures that even a close ally is engaged in industrial espionage could be extremely damaging. It may take a long time to restore trust.''
Other Japanese officials say the case could revive the old image of a threatening, monolithic ''Japan Inc.'' pursuing its own economic interests at any cost. They feared it might encourage an anti-Japanese mood already evident in Washington.
Revelations of the lengths to which some Japanese companies allegedly will go to gain an economic advantage could strengthen the feeling in Congress that legislation is needed to protect United States industry from its main foreign trading partner.
Analysts here cite the example of so-called reciprocity legislation and US moves to halt automobile imports by insisting on local production of all foreign cars - neither action considered friendly to Japanese interests.
In Japanese eyes, relations have not been helped by the way the Reagan administration generated massive publicity for its spying allegations, which the Japanese say were based on an entrapment exercise. Japanese find the publicity distasteful and even immoral. Surely, it is said here, between supposedly close friends the situation could have been handled more discreetly.
The heavy-handed approach lent some credence to a theory here that the spy charges are really a carefully prepared plot by the US computer industry to discredit its Japanese rival and ensure continued US domination. The computer firms involved, Hitachi and Mitsubishi, have key roles in a government strategy to double (from 15 to 30 percent) in this decade the country's share of a world market dominated by IBM.
Beyond industrial considerations, there has to be concern on both sides about unstable elements in US-Japanese relations. Among these elements are trade frictions involving a wide range of products vital to US economic well-being, US irritation over low Japanese defense spending, and a dispute over US economic sanctions against the Soviet Union.
President Reagan's announcement June 18 that the US will continue its ban on export of certain oil-drilling equipment to the Soviets caused outrage in Japan. The Japanese have has a joint oil and gas exploration project off Sakhalin with the Soviets that Japan regards as vital to national interests.
Initally there was talk of protesting that the resource-rich US was punishing a resource-poor poor Japan, and not the Soviets. But the government has toned down its anger to avoid worsening relations with the US.
Some officials are particularly unhappy at the implications of Japan being forced to line up against the US with the economic interests of the Soviets.
Admittedly the Japanese find President Reagan a bit bewildering at times. Last year they went along reluctantly with Western sanctions against Poland. They were highly indignant when Mr. Reagan dropped these later without any prior consultation.
The announcement of the IBM spying charges therefore inject a fresh emotional element into the Washington-Tokyo relationship at a particularly difficult moment.