The Rhodesian government expelled an American nun today after holding her in jail three weeks on charges of violating security laws.

Sister Janice McLaughlin, 35, of Pittsburgh, was a member of the Catholic Commission for Justice and Peace in Rhodesia that prepared a report alleging systematic torture of blacks by the Rhodesian security forces. The report was made public in London yesterday.

As McLaughlin was boarding a plane to take her to Johannesburg and then New York, about two dozen priests and nuns - black and white - broke into a melodic rendering of Black Africa's national hymm "God Bless Africa: Listen to Our Prayers."

Aboard the aircraft, she described her detention as "almost a privilege," being imprisoned with people committed to liberating Rhodesia.

Although the United States does not maintain diplomatic relations with the white-minority government of Rhodesia, the Carter administration was reported to have exerted heavy pressure on the South African government, Rhodesia's principal ally, to obtain the Maryknoll nun's release.

Three other commission members still awaiting trial - two priests and a lay official - have also been charged with violation of security laws. Last Friday McLaughlin was refused bail after the judge ruled that she presented a "grave security risk" as a "dedicated supporter of the terrorist cause."

On the plane ride she said she would rather have stood trail, and had considered contesting the deporation. She said she felt guilty winning release by outside intervention when hundreds of others without possible external assistance are still imprisoned.

Although she was imprisoned in the white area of Chikarubi women's prison, she said three are about 260 women inmates in the African section, mainly charged with attempting to cross the border to join insurgent forces.

During her court appeal for bail, the government introduced statements - mainly from her diary - that McLaughlin "romanticized and glorified the guerrillas," that she had attempted to set up a meeting with gangs operating inside the country, and that she would have joined the insurgents if she had black skin.

The American nun, who has held various posts in Africa for more than seven years, said her brief stint in Rhodesia as press officer for the Catholic Commission of Justice and Peace had not changed her views.

She had some angry things to say about the Rhodesian government and military, which she charged has "policy" of torturing African civilians either to obtain information or as retribution against suspected guerrilla supporters.

She said that in one recent incident, as yet unpublished by the commission, about 150 black students had been rounded up by Rhodesian security forces for questioning.She said several of the students had been beaten and four had been tortured with electric shocks.

"I believe the Rhodesian government is becoming desperate in its struggle against the guerrillas," she said. "It must feel very threatened by the freedom fighters to have arrested some foreigner just because she supported them."

But McLaughlin, who was in Rhodesia only three months, commended several police officials for being "very nice" to her. "It's the system that's wrong, and people have become caught up in it. Most of the people, including prison guards and police, treated me well."