Led by Democrat Sharon Percy Rockefeller, the board of the Corporation for Public Broadcasting voted in a secret session yesterday to refuse to seat President Reagan's latest appointee, New York corporation executive William Lee Hanley Jr.

The action, which preserved the board's threatened Democratic majority, set the stage for a sharp confrontation between the White House and the CPB, which distributes public funds to the nation's public broadcasting systems.

Rockefeller contended in an interview after the meeting that Hanley's recess appointment--made Monday shortly before Congress reconvened and without Senate confirmation--was illegal. She said the board acted to prevent "undue influence" by the White House on the CPB.

" Hanley's appointment was proper and appropriate and we are now assessing our options on it," a White House spokesman said yesterday.

The CPB action came after Hanley, carrying an official document signed by Reagan appointing him to the board, appeared at the CPB office yesterday morning and demanded in what he called a "firm but polite" way to be seated.

"Counsel convinced me I was entitled to be seated, but I'm not a constitutional lawyer," Hanley said later. He said his legal advice came from the Justice Department. Hanley was Connecticut coordinator for the Reagan campaign.

After refusing to seat Hanley, the board went into public session for its annual meeting and reelected Rockefeller as chairman. Republican vice chairman Sonia Landau, apparently unable to muster enough votes to remain in her post, resigned it but remained on the board.

The decision to bar Hanley was announced in the public session, but the vote count was not given. CPB counsel Linda C. Dorian said in an interview later that recess appointments are not allowed at CPB because it is a private corporation operating under different rules than apply to government agencies.

CPB was established by Congress to funnel public money to the nation's public broadcasting systems--primarily National Public Radio and its television counterpart, Public Broadcasting Service--while insulating public broadcasting from political influence.

"Insulation is the issue," said Rockefeller yesterday when asked in an interview why Hanley had been refused a seat.

The refusal to seat Hanley preserved the board's 8-to-6 Democratic majority. Hanley was appointed to replace Democrat Gillian M. Sorensen, whose term expired in March 1982 but who, under the law, continues to serve until her replacement is appointed.

Sorensen, who kept her seat through the public annual meeting yesterday, said in an interview later that the White House was trying to "pack the board" with the last-minute appointment of Hanley.

"There was ample time for the normal process," she said. "Why do it in the last 24 hours? The process Senate confirmation exists for a good reason. It's cumbersome but we all went through it. It seems a subversion of the process to scramble around it."

Hanley would balance the board at seven Democrats and seven Republicans. A simple partisan split fails to explain the complex politicking at CPB.

For example, Rockefeller is so popular as chairman that she was reelected yesterday by a unanimous vote, and two Republican Reagan appointees--California communications executive Harry O'Connor and Texas political consultant R. Kenneth Towery--spoke strongly in her favor, even though they said they thought it was illegal for the board to exclude Hanley.

And Hanley, though denied a seat, sat in the audience through the public session listening attentively, laughing at the jokes and even applauding Rockefeller's reelection.

CPB sources said the White House rush to seat Hanley was instigated by Landau, who feared she needed the extra vote to remain vice chairman but who failed to take account of the anger that the unusual procedure could stir in many board members.

When that anger surfaced, the sources said, the board decided not to seat Hanley, and Landau was forced to resign as vice chairman. However, the sources said that because of the turmoil, plans to elect ITT general counsel Howard A. White as the new vice chairman were temporarily put aside, and no vice chairman was elected.

Landau said in an interview later that she had the votes to be reelected but chose not to for technical reasons having to do with changes that will reduce the number of board members next spring.