Despite doubts about the legality of what they were doing, U.S. immigration officials two summers ago set up a program aimed at speedy, wholesale deportation of Haitian refugees from south Florida.

Documents made public in U.S. District Court here this week suggest that the Immigration and Naturalization Service knowingly ignored usual processes and decided to single out the Haitian "boat people" for deportation.

The memos and policy papers provide an unusual insight into workings of the INS and its parent Department of Justice in their efforts to cope with an influx of thousands of Haitians seeking political asylum in the United States.

The legality of the INS efforts and the denial of due process to the Haitians is a key issue in the trial of a suit brought by the National Council of Churches and civil rights organizations.

A picture that emerges from the INS documents in one of alarm over an "invasion" of south Florida by the Haitians and the creation of an assembly-line processing program to deny asylum and send the boat people home.

Attorneys for the thousands of illegal refugees here maintain that they are fleeing the tyranny of the Duvalier regime in Haiti and must be considered political refugees. The government insists that they are "economic" refugees who must be returned to Haiti.

A flood of several thousand new refugees in recent weeks, all arriving on small private boats or brought here by smugglers, has intensified debate over the Haitians' status in Florida.

Local officials estimate that at least 25,000 Haitians have come here illegally in the last decade, putting an increasing strain on private and public assistance programs.

The litigation has prevented INS from moving ahead with its deportation program. The refugees, meanwhile, with support from civil rights groups, are mounting a campaign to win asylum by presidential decree.

Several hundred of them marched to the INS headquarters in downtown Miami today to hear the Rev. Jesse Jackson of Chicago, a new advocate of their cause, pledge to take an appeal for asylum to President Carter next week.

"There is room in the United States for Cubans trying to escape from oppression; there is room for Haitians trying to escape oppression," Jackson told the cheering marchers.

While the Haitians were turning to the streets, their legal battle was being fought in Judge James Lawrence King's courtroom. King is expected to rule on the class-action suit in several weeks.

At one point during the trial, the judge equated the fearsome Haitian prisons with INS processing rooms -- decorated with visit-Haiti tourist posters -- where tightly packed refugees were forced to stand for hours before seeing ill-trained INS examiners.

The Justice and INS memos, however, may turn out to be crucial elements in King's decision. They lay out an expulsion policy whose legality was being questioned by some INS officials.

The policy apparently was directed by former associate attorney general Michael J. Egan, who instructed INS to move quickly to process claims and suspend issuance of work permits to the refugees.

The documents show that as Egan's order moved down the line through INS, it took on new urgency as different officials added their interpretations and instructions to acting Regional Director Richard Gullage.

One memo, written by INS Associate Commissioner Charles C. Sava, capsulized the federal policy: "The best, most practical deterrent to this problem is expulsion from the United States."

Other documents showed an intense interest by the State Department and the White House in dealing with the increasing flow of Haitians.

A summary of an August 1978 meeting said that the State Department would urge INS to revoke work permits of Haitians arriving here, while the department would mount "a propaganda campaign" in the Caribbean to discourage Haitians from leaving home.

Other approaches were planned to persuade the Bahamas to crack down on smugglers taking Haitians to Florida and to get the Duvalier regime to agree publicly not to retaliate against returning Haitians.

Under law, Carter has until May 15 to declare blanket amnesty for the Haitians, a move that administration officials say is unlikely because it might set precedent as an open invitation for more Haitians to come here.

Most of the Haitian boat people, they face torture and imprisonment as "traitors" and "spies" by the Duvalier regime if they are sent home.

Today's march followed a rally and funeral mass for four boat people -- one who died while in INS detention and three unidentified refugees whose bodies washed onto Florida shores.

The bodies rested in plain caskets at the front of a church auditorium, while Haitian leaders and local civil rights activists exhorted the crowd in French-Creole and English.