Here is a riddle for the 1990s: If the government works so badly, why would anyone with talent want to work in government? But if no one with talent works in government, how can the government possibly work well?

For at least a decade, the government has been unfashionable and so government work -- once proudly called public service -- has become unfashionable work. The result is a potential crisis at all ranks of the Civil Service that worries not only the friends of government activism but also critics of "big government" who fear that the quality of even the most basic government services may be in decline.

Virtually everyone agrees that part of the problem is that government pay and benefits lag behind those of the private sector. But many argue that the government's recruiting difficulties transcend pay and stem from a decline in the ethic of public service that once drew thousands to government. The roots of that decline are political, the product of the war against government that has been going on since Vietnam.

Steven Kelman, a professor at Harvard University's Kennedy School of Government, said that former president Ronald Reagan's campaign battle cry that "government isn't the solution, it's the problem" had a powerful effect not only on election results but also on the thinking of students contemplating their futures. "If you hear that government is the problem, not the solution, why would anyone want to be part of the problem?" Kelman asked.

He is a Democrat and his critique of the former president is not surprising. Indeed, many conservatives argue that talk about the need for a renewed sense of public service is a new liberal ploy.

"This is the kind of standard party line of those in the government who represent its internal interest," said Donald J. Devine, who served as director of the Office of Personnel Management for part of the Reagan administration. "It's basically a cover to get more money."

But other conservatives say that the war against government did have some negative side effects.

"Conservatives have a rhetorical legacy to contend with that includes a very sharp critique of government," said Terry Eastland, who served in the Reagan administration and is now a resident scholar at the National Legal Center for the Public Interest, a conservative think tank. Eastland said that while he too opposed "LBJ-style big government," the conservative critique was "so overstated as to make conservatives believe that government shouldn't exist."

Stephen Macedo, an associate professor of government at Harvard, said that while "there are certainly people who think that government should shrink, and I'm one of them," conservatives "ought to have a finely honed sense of what government ought to be doing, as well as a sense of what it ought not to be doing." He said conservatives need to encourage "public service, public spirit and public commitment to those limited but necessary services" that government performs.

While many historians warn against a nostalgia for some golden age of public commitment, it is clear that government used to be seen as much more exciting -- and effective -- and thus a more attractive place to work than it is now. After the War, High Esteem

"There's a certain poignant contrast between the 1990s and the period after World War II," said Harry Boyte, director of Project Public Life, which is launching efforts to reconnect young people to politics and government. In the late 1940s, in the wake of the New Deal and America's victory in the war, government, and government work, was held in high esteem.

"People tend to be attracted to the activity in society that seems to be responding to the most severe problems the country faces," Kelman said. In the Depression, the popular perception was that "the private sector was the problem, not the solution," so government drew thousands among the country's best and brightest. At the height of the Cold War in the 1950s, "it's not surprising that the CIA got a lot of very talented people." And the popularity of the Peace Corps made sense in the immediate post-colonial period of the 1960s.

John F. Kennedy also had something to do with this, and advocates of public engagement see his efforts to make government exciting as models for what a president ought to be saying now.

"Let public service be a proud and lively career," Kennedy said in 1963. "And let every man and woman who works in any area of our national government, in any branch, at any level, be able to say with pride and with honor in future years: 'I served the United States government in that hour of our nation's need.' "

"Nobody's made that kind of speech for 25 years," said Charles Peters, the editor of the Washington Monthly who served the Peace Corps as director of evaluation.

The reasons for government's declining standing since then are well known: the problems associated with Lyndon B. Johnson's Great Society, the Vietnam war, Watergate, and the Carter administration's image of failure in economics and foreign affairs.

But at least as important as the decline in government's cachet was the rise in the private sector's standing in the 1980s, when business and entrepreneurship won a degree of popular acclaim that it had not enjoyed since the 1920s.

"We had a glorification of private striving, of competitive success in the marketplace," said Will Marshall, president of the Progressive Policy Institute, a think tank that usually expresses the views of centrist Democrats. "Our heroes were swashbuckling captains of finance and industry and not people who were solving public problems." The results were not surprising, he said: Applications by college students for government jobs declined, while business school enrollments soared.

In the meantime, the Reagan administration chipped away at the public sector. Devine thinks that this effort drew as many people to the government as it pushed away. "I think it was as challenging taking the welfare state apart as it was putting it together," he said. "In fact, it takes more intelligence."

But Kelman argues that it is the creation of new government agencies that tends to bring the freshest blood to middle levels of government, young people in search of the "new and exciting." Thus, he noted that many were drawn to public service in the 1970s by the creation of the Environmental Protection Agency and the Occupational Safety and Health Administration. The PACE Fell Off

The government's recruiting problems, highlighted in a report issued last year by the National Commission on the Public Service chaired by Paul A. Volcker, came into sharp relief this June when only 85,000 applicants showed up for a new Civil Service exam for professional jobs. The exam had not been given in nine years because the old Professional and Administrative Career Examination, popularly known as PACE, was dropped in the waning days of the Carter administration after civil rights groups charged that it discriminated against minorities.

Athough there is much dispute over how to compare this year's figure with those of nine years ago, even the most conservative estimates suggest a drop of at least 30 percent in the number of people taking the exam, and some suggest a much higher drop.

Constance Newman, director of the Office of Personnel Management (OPM), argues that comparisons with the past are misleading because the government had a short lead-time in which to advertise the new exam. The old exam, by contrast, was an established institution and university placement offices routinely channeled students toward it.

If there is an argument about the exam figures, there is no dispute about the shortage of applicants for technical jobs in government. In an effort to speed recruitment for such jobs, OPM has freed agencies from some of its hiring rules and offered special pay rates.

Pat Lattimore, deputy associate director for career entry at OPM, said the jobs for which agencies have been given "direct hire" authority include engineers, physical scientists, nuclear physicists, mathematicians, accountants and computer programmers. Rep. Gary L. Ackerman (D-N.Y.), who is sponsoring a federal pay raise bill, said that 200,000 employees are now on special pay rates.

But specialists in the workings of bureaucracies argue that beyond raising pay, the government also needs to consider changes in its recruiting methods and in the nature of government work.

Kelman said that while private employers can send recruiters onto campuses and make hiring decisions on the spot, government procedures usually involve a complicated application process and long waits. The whole process, he said, "gives the image of excessive bureaucracy to the kids you want to hire."

In addition, he said, scandals have created a double burden for government recruiters. Not only do scandals turn people off to government, they also lead to the extra layers of rules restricting the actions of public employees. The new rules are designed to prevent further corruption but have the additional effect of limiting the creativity andd flexibility of government employees.

David Osborne, a student of government programs who is writing a book called "Reinventing Government," said that government suffers among potential employees from a broader image problem: It is out of sync with a national mood that emphasizes decentralization, wide diffusion of authority within the organization and "consumer orientation."

"We're using basic methods in the public sector that come out of the 1920s and 1930s," he said. "We created a bureaucratized, standardized, centralized government that delivers services to mass markets. We need to restructure the public sector in the same way we have had to restructure the private sector."

Newman says that the federal government is responding to criticisms such as those offered by Kelman and Osborne by increasing, for example, the authority of recruiters and by trying to reform the workplace to give employees more decision-making power.

But the biggest and most helpful change, she insists, is a new approach to government by the White House. "We have a president who believes he is a public servant and is sending that message," she said. Part of the Solution

What does seem clear is that the spirit of the 1990s will be more conducive to government work than the spirit of the 1980s. For one thing, the problems faced by some of industry's swashbucklers have taken some of the sheen off the image of finance, real estate and other more speculative lines of work.

Even the government's housing and savings and loan scandals are sending a complicated message, since they reflect badly on both government and the private sector. By suggesting that private interests may need more regulation after all, both scandals showed that if bad government was part of the problem, it was not the whole problem; and that competent government was an essential part of the solution.

For her part, Newman is adjusting her message to a time of modest expectations. "We're not all running up to the moon and we're not all getting the exciting chance to go start up a Peace Corps," she said. "But there are still some exciting things the government can do."