Lawrence A. Bailey, one of the highest-ranking black assistants in the White House, is resigning to go to work for a newly formed export-import company based in Los Angeles.

Bailey, whose title is deputy assistant for intergovernmental affairs, said yesterday he will leave the White House staff May 15.

"I'm leaving because it's a tremendous opportunity," he said of the California job.

Bailey's planned resignation served to underscore the lack of black presidential assistants in high-level posts in the White House.

Although President Carter promised an aggressive recruiting campaign to place blacks in top-level posts throughout the government, according to estimates there are only about a dozen black professionals on the White House staff.

The highest ranking of thses is Martha M. (Bunny) Mitchell, a special assistant to the president (a second-level job) whose duties have remained vaguely defined since the beginning of the administration. Bailey, whose salary is $47,500 a year, is the second-highest-rannking black on the staff.

Senior White House officials concede privately that they have done a poor job of dealing with the black community, which was crucial to Carter's 1976 election.

Seeking to remedy this, the president recently offered a White House senior staff position to Mayor Richard G. Hatcher of Gary, Ind., one of the more articulate black politicians in the country.

Hatcher reportedly is still mulling over the offer and is expected to give Carter his answer in a few weeks.

Bailey, according to one of his friends, had become disenchanted with the Carter White House and felt that he was not part of the decision-making process. A similar complaint has been voiced by other White House aides below the most senior level.

Bailey, however, yesterday denied any disenchantment.

"I'm still optimistic about a number of things this administration can accomplish," he said. "I'm not coming out feeling bad."

Bailey previously was an urban staff specialist with the U.S. Conference of Mayors. He went to work for the Carter campaign in July 1976 as part of the Atlantic-based staff that was planning for the new administration in the expectation of a Carter election victory.