THE SHELTER problem in the District is poised between farce and tragedy. The main problem no longer has to do with either of the parties -- the federal government and Mitch Snyder of the Community for Creative Non-Violence -- that has dominated the sorry events of the last year. It has to do with a third party, unfortunately an extremely reluctant one. You may remember him. His name is Marion Barry, and he is the mayor.

The current stage of the crisis was precipitated by a court order last month to close the indescribably squalid Second Street shelter where Mr. Snyder has been housing homeless unfortunates for two years. As a condition, however, the judge said the federal government, which happens to own the shelter, must find alternative housing for the current 600 residents. In the interval, Mr. Snyder has stood by unhelpfully, fully aware that the government could not meet the condition in the time allotted. The mayor has also stood by, as though the dispute were taking place on another planet and he had never visited it.

But the mayor does have a role, a central one. Everywhere else in this country, caring for the homeless is a municipal responsibility, and so it is here as well. Only by the accident of federal ownership of the decrepit building that Mitch Snyder started using two years ago did the feds get into the shelter picture here. They have not done well at it, but at this point they should not be doing it at all. Nor is there good reason why a private citizen like Mitch Snyder should be dictating the terms for resolution of this issue. The city government should be caring for its homeless. As mayor, Mr. Barry should be leading the way.

The Barry administration points out that it is spending $7.3 million this year to operate 844 beds for homeless people in other shelters. That's very nice, but it is not the limit of the city's obligation. Mr. Barry has been offered an additional $2.7 million by the federal government to relocate the Second Street people. He looks the other way. Marion Barry is a man who made his reputation and political career by taking up the cause of people without power. Now he has an official responsibility to help a particularly needy group of people without power. It is a scandal that he does not do his duty.