Ayatollah Ruhllah Khomeini returned in triumph to the holy Moslem city of Qom today and delighted his fundamentalist Shiite audience with broadside attacks on his two favorite whipping boys -- the West and the left.

Exactly one month after he ended his 14-year exile, the Iranian spiritual leader was given a minor version of his homecoming welcome by hundreds of thousands of Iranians, according to extensive reports reaching here.

With problems piling up -- and his handpicked Prime Minister Mehdi Bazargan threatening to resign unless his party is respected -- Khomeini is thought likely to remain in Qom, removed by nearly 90 miles and even greater psychic distance from running everyday government affairs in Tehran.

Scenes of mass tumult accompanied the 77-year-old Khomeini's return to Qom, where he first attracted public attention in the early 1960s by attacking Shah Mohammad Reza Pahlavi and the Weat. Hammering home his traditional line, Khomeini pledged, "We will put an end to Westernization... All the corrupt practices of the West must be eliminated... The West has debased us and destroyed our spiritual life."

He swept aside left-wing and liveral object/ons to his dream of turning Iran into an Islamic republic by insisting that any other description, "just plain republic" or "democratic republic," was based on "Western terms we reject."

As the crowd roared its approval, Khomeini said, "All who believe in Islam should vote March 30" in the planned referendum for establishing an Islamic republic.

Hitting out at the extreme left, he said, "To weaken the government is to weaken Islam. To weaken the Army is toweaken Islam."

The Marxist left and its liberal allies have sought to push ahead with the revolution for fear Khomeini was trying to substitute his own tyranny for that of the now ovetthrown shah.

All of Iran's ills stem from blindly following Western models, Khomeini told an audience at the Thelolgical School. However, he insited that the referendum would be "free" and, amid booing, added, "People can even say theyt want the return of the shah,"

Warming to his fundamentalist audience, many of whom were turbaned clergymen, he said, "We do not want our judicial system to be Western. We do not want our laws to be Western. We have divine laws, Islamic laws."

Khomeini said interest rates and prostitution will be abolished; Iran's red, green and white flag will be replaced by an Islamic emblem; a special ministry will be set up outside normal government channels to watch for corruption, and the poor will receive free electricity, water and bus service.

The press and the government-run radio and television service must "not betray Islam," he said. This was an apparent allusion to the liberals and leftists who have opposed Khomeini's efforts to direct the media.

Khomeini drove from Tehran, rested for an hour in an Army camp near Qom and then entered the holy city in an ambulance protected by troops. Armed civilians beat back the crowds and turbaned mullahs broke branches off trees to whip the unruly mobs back into line.

Ayatollah Kazem Shariatmadari, the senior religious figure in Qom, welcomed Khomeini.

In an interview yesterday, Shariatmadari, a leading moderate especilly popular in his native Azerbaijan in nodrthwestern Iran, said, "Now that Khomeini is coming to Qom, it will be possible for us to sit down, talk and solve the problems together."

Throughout the year-long struggle to overthrow the monarchy, the two men often were described as revals. Observers noted that despite denials the very fact that it took a month after Khomeini's return to Iran to arrange a meeting was eloquent comment.