The Senate last night passed a bill requiring about 20,000 high-ranking employees of all three branches of government to file public financial reports each year, detailing earnings, income from stocks and bonds and major financial holdings. The final vote was 74 to 5.

Before passage, the Senate by voice vote added an amendment by Sen. Donald W. Reigle Jr. (D-Mich) setting up a mechanism for possible appointment of a special federal prosecutor to look into allegations that Korean businessman Tongsun Park made hundreds of thousands of dollars worth of payments and gifts over the past few years to members of Congress to sweeten their attitude toward continued U.S. financial aid to Korea.

The Riegle language was in addition to a general provision calling for appointment of special prosecutors whenever crimes are alleged to have been committed by the President and high-ranking executive-branch officers.

The bill now goes to the House where committees are working on financial disclosure codes for the three branches of government.

The bill's reporting requirements are based on codes adopted by the House and Senate earlier this year for their own members and employees. The bill writes these requirements into law for Congress with some minor changes, and also requires the same public financial disclosure for the first time for members and employees of the executive branch and judiciary, from the president down to all those at the equivalent of GS-16 or above. It also applies to military officers with the rank of O-7 (brigadier general and rear admiral) and higher.

President Carter, in a letter from counsel to the President Robert J. Lipshutz, warmly endorsed the basic measure as a "matter of high priority" to the White House.

An aide to Sen. Abraham A. Ribicoff (D-Conn.), the bill's floor manager, said about 15,000 members of the executive branch and 5,000 congressional and judicial branch personnel would be covered, effective Jan. 1, 1978. Some already report on their finances, but the executive and judicial reports aren't available for public inspection under current laws and rules.

In addition to the reporting provisions, the bill also includes these other "integrity in government" provisions:

Authorizing appointment of a special prosecutor by a special five-member panel of judges (chosen by the chief justice) whenever the Attorney General finds that a charge against the President, Vice President, a Cabinet member of other high-ranking official requires investigation.

The mechanism for appointing any special prosecutor to investigate the Tongsun Park allegations would be similar.

Creating a special office of Legal Counsel for Congress, to defend it in force congressional subpoenas, and to intervene as a "friend of the court" in matters involving congressional prerogatives. Sponsors said Congress usually depends on the Justice Department to represent it in the courts, but in some cases the institutional interests of Congress and the department might be different.

Creating an Office of Government Ethics within the Civil Service Commission to be headed by a presidentially appointed director, to give uniform government-wide enforcement to existing codes of conduct for the executive branch, and to implement the bill's financial disclosure provisions.

Forbiding former high-level members and employees of the executive branch, the military and the District of Columbia to have any contact with their former agencies or employers for one year after leaving, in order to prevent conflicts of interest arising from their former jobs.

The disclosure provisions would require reporting on the amount and source of salaries, wages and honoraria, cash gifts of $100 or more and non-cash gifts of $250 or more from any one source, "unearned" income (dividends, interest, etc.) by category or value, and holdings of personal and real property and business transactions by category of value.

Less detailed reports would br required on the finances of a spouse or child. However, under an amendment adopted on the floor yesterday, reports on spouse or child would not be required if the covered employee could not obtain the information and derived no direct benefit from such holdings.

A floor amendment, backed by President Carter, would permit exclusion of reports on the holdings of a blind trust, but only under stringent conditions so that the trust would be genuinely blind. This would enable rich senators and government officials to report only the income from the trust.