A shaky House-Senate compromise that could wrap up nearly $40 billion in spending cuts apparently hinged last night on whether the White House will write a letter of absolution for Senate Human Resources Committee Chairman Orrin G. Hatch (R-Utah).

The senator reportedly wants to be relieved of responsibility if he omits family planning money from a proposed health block grant.

Hatch is feeling heat from some fellow conservatives for compromises he has had to make as committee chairman, and many conservatives would like to see family planning aid sent into oblivion by way of a block grant.

So Hatch asked for a letter of absolution, sources said. But White House aides balked, so Hatch balked, too.

"It threatens to knock the whole thing out of the water," said a source close to the block grant negotiations.

Senate and House leaders had hoped conferees would finish work on the huge budget "reconciliation" bill by last night, by several logjams remained, including a dispute over the administration's proposed "cap" on growth of Medicaid spending as well as the family planning issue.

Conferees were still negotiating over something short of a Medicaid cap that would include reduced spending levels coupled with incentives for saving even more. On the health block grant, conferees said a tentative agreement had been reached to include 19 to 25 health programs, or $1.2 billion of $1.8 billion in health spending, in block grants to the states -- so long as Hatch can resolve his problems.

Among the issues that did get resolved yesterday were radio television deregulation. Conferees agreed to extend the terms of licenses for television stations from three years to five years and for radio stations from three years to seven years. But they stopped short of much more comprehensive deregulation that had been proposed by the Senate.

Conferees also omitted the Legal Services Corp. from the budget bill, leaving its fate to the normal authorizing and appropriating process. Reagan wants to get rid of the controversial agency, which provides legal assistance to the poor, but the House has boted to keep funding it at a rate of $241 million a year, more than twice what would have been provided in the reconciliation bill.

Professional Standards Review Organizations (PRSOs), panels of physicians who try to keep down hospital costs under Medicare and Medicaid, were also given a new lease of life, as conferees dropped a House provision that would have phased them out by 1983.

Radio and television deregulation was one of the last survivors in a group of controversial, essentially non-budgetary items that were tucked into the budget reconciliation process to avoid some of the normal problems in passing legislation, such as Senate filibusters and presidential vetoes.

The Senate Commerce Committee had proposed sweeping telecommunications deregulation, including permanent licenses for radio stations, extended licensing terms for television stations, lotteries for awarding new license and ratification of a Federal Communications Commission decision not to require minimum amounts of news and informational programming or maximum limits on commercials.

The House proposed no telecommunications changes, but wanted more money than the Senate committee proposed for the Corporation for Public Broadcasting in future years.

The compromise that was struck gave the Senate some easing of controls over commercial radio and television and the House less of a cut for public broadcasting.

In addition to longer terms for radio and television licensing, the FCC will be authorized to experiment with awarding new licenses by lottery, replacing the current practice of competitive hearings by applicants before the FCC.

In exchange, the Corporation for Public Braodcasting, which operates under advanced funding from Congress, will receive $130 million annually in 1984, 1985 and 1986. This represents a cut from its current funding of $172 million a year but a substantial increase over the $100 million to $110 million annual spending levels that the Senate had recommended for the three-year period.

"We didn't get all we wanted," said Senate Commerce Committee Chairman Bob Packwood (R-Ore.), "but we gave up a little money for public broadcasting to provide some relief to commercial broadcasters."

Meanwhile, conferees appeared to be nearing agreement on how to proceed with the sale of Conraol, the federally subsidized railway freight system serving principally the Northeast.

The big issue is whether to sell the money-losing railroad as a unit or permit the Department of Transportation to seel it in pieces. The Senate prefers a quick sale, by not later than the end of 1982. House members, who contend it is important to sell the system as a unit to maintain service to all areas, have been arguing for another year or two to give time to find a buyer for the entire system.

Another issue was constitution of a board to make the determination, if necessary, that the department, if necessary, that the department has made a good faith effort to find a buyer but could not and that the system should be sold piecemeal.