Margaret Randall decided 21 years ago to become a Mexican citizen, she said, because her children were hungry. She was living in Mexico City, married to a Mexican and hoped that citizenship would help her obtain a better-paying job. She said there was no indication that she might be endangering her U.S. citizenship.

Today Randall, 50, a feminist poet, college professor and writer of dozens of books and articles, is struggling with the Immigration and Naturalization Service (INS), which is trying to deport her. The INS says she renounced citizenship in 1967 and is ineligible to stay in this country because of her political beliefs.

The Reagan administration said last June that it wants to change the section of immigration law that excludes aliens based on their writings or beliefs. The INS is trying to deport Randall because it considers her a communist.

In 1986, a writers group including such prominent literary figures as Edward Albee, E.L. Doctorow, Arthur Miller, Kurt Vonnegut, Alice Walker, Norman Mailer and Saul Bellow joined Randall in filing a lawsuit on her behalf, calling for repeal of the portions of the law barring aliens on the basis of their writings.

The U.S. District Court here has rejected the claim, at least initially, saying Randall must exhaust her INS appeals first.

Randall, who denies that she is a communist, returned to the United States in 1984 after 23 years to marry an American, teach at the University of New Mexico and settle in Albuquerque near her elderly parents. She has four children, two Americans and two with Mexican-American citizenship.

While abroad, she lived in Mexico, Cuba and Nicaragua, visited North Vietnam and wrote extensively about women in those countries and favorably about revolutions there. "This administration is so down on Cuba and Nicaragua, and the fact that I lived in those countries and wrote about them," she said.

When she returned, she asked the INS for permanent-resident status, but the agency refused it, claiming on the basis of her writing that Randall is a communist and thus ineligible.

Immigration Judge Martin Spiegel found in 1986 that, based on 2,744 pages of her writings, Randall is an advocate of "the economic, international and governmental doctrines of world communism" and agreed that she should be deported.

Randall, represented by attorney David Cole of the Center for Constitutional Rights, appealed the decision to the Immigration Board of Appeals last October and is awaiting its decision.

INS spokesman Duke Austin summarized the case by saying, "Basically, she left the United States, went to Mexico, married a guy there, got Mexican citizenship through the marriage, then later went to the American consulate and renounced her U.S. citizenship at the age of 31.

"Giving up your citizenship is a severe act . . . . Had she never given up her citizenship, she wouldn't be in this position. But she did it. She's a Mexican citizen trying to enter the United States," Austin said.

Randall, teaching this academic year at Trinity College in Hartford, Conn., denied that she renounced her citizenship.

Cole said in an interview that the U.S. consulate in Mexico City contacted Randall after she acquired Mexican citizenship to ask whether she intended to give up her U.S. citizenship and was told that she considered herself an American.

She said she returned to the U.S. consulate about 1969 and "signed an affidavit that I would never have . . . no matter how hungry my children were, if I had understood."

Austin said that, after obtaining Mexican citizenship, Randall never changed her occupation. She worked with Sergio Mondragon, then her husband, to launch a bilingual literary magazine.

"Her story is fraught with really twisted facts," Austin said. "She says she didn't know what she was doing when she gave up her citizenship. But she wasn't 15 years old. We're not talking about a naive child here. And she didn't change her mode of employment one iota."

Randall said she tried but was unable to obtain a better job, even with Mexican citizenship. "I had hoped to get a good job with a big company. That never happened, but I was able to make more money. I always worked multiple jobs, free-lance writing, translating, teaching English, doing book reviews, whatever."

Last June, State Department legal adviser Abraham D. Sofaer testified before Congress that the department "has long believed that changes are necessary to bring the exclusion and deportation provisions in line with modern reality . . . . It's an anachronism to say that, just because someone held some particular political view at some point in his life, he should be denied immigration."

Congress adopted that view last month in an amendment to the 1988 State Department authorization bill. It said aliens may not be denied entry to the United States on the basis of "past, current, or expected beliefs, statements or associations."

Austin said the INS does not believe that a change in the "ideological exclusion" would affect Randall since she seeks permanent immigrant status, rather than a visitor's visa, which the INS is willing to issue. "She has several times been granted visas to enter the United States," he said. "No one's afraid of her ideas."

"The only question in this case is whether she is eligible to regain her citizenship by immigrating here," he said. "We say no."

Randall cannot be deported until her appeals are exhausted and also cannot travel outside the country. As a result, she has not seen her first grandchild, born two months ago to a son temporarily working as an engineer in Paris. She also expects to miss the birth in Mexico of her daughter's baby, due next month.

"They're angry that I won't say I'm sorry {about what I've written}," Randall said. She conceded that she "might not use the same language today," but said, "The issue is not what was said but one's right to say it."