"Mayflower Madam" is a new kind of morality play for television. The cops and other authorities are the bad guys and a woman who runs an illegal call-girl operation is clearly the heroine. Not only that, she is played by Candice Bergen, an extremely beautiful actress who absolutely exudes guileless classiness on the screen.

The CBS movie, tomorrow night at 9 on Channel 9, was to have been based on the autobiography of notorious society madam Sydney Biddle Barrows, that enterprising Mayflower descendant, but producer Robert Halmi had so much trouble getting script approval by network censors that an opening credit now says the movie was merely "inspired by" her life, perhaps the way those composer biographies of the '40s were inspired by, but had little really to do with, the lives of the composers.

At any rate, even watered down and tidied up, the story, as written by Elizabeth Gill and Charles Israel, is an entertaining and persuasive defense of Barrows and her tony, fashionable "escort service" -- one designed for, she says during the film, "well-to-do gentlemen who don't want to be alone."

By this account, Barrows was virtually forced into the life that eventually got her splashed all over the press. She is fired from a legitimate office job by a jealous, paranoid boss who says, "You don't follow orders." At job interviews, she is greeted with corrosive discouragement. In desperation she takes a post as receptionist for a seedy, sleazy escort service and, when one of the young women is beaten by a coke-freak client, sees her role as establishing new standards in respectable and hygienic prostitution.

Few of the hygienic details are included here, but they've all been discussed on the "Donahue" show anyway. Soon Barrows' service, Cachet, is launched with ads in New York magazine and a flock of gorgeous gals who charge $125 an hour and more for their services (Voluptuous Mona goes for $225, with a two-hour minimum). The film's depiction of their trade-plying is so squeaky clean you'd think they were dispatched to be nannies and nursemaids. Which in a way, of course, they are.

The cops, on the other hand, and the prosecutor who pursues the case against Barrows are portrayed as ambitious and unsavory prudes and moralists. A viewer's sympathies are easily won by Bergen and her girls (the film at times seems a libidinous twist on "The Prime of Miss Jean Brodie"). Bergen still has that warming, effortless glow, and she makes the most of such tiny details as the fact that, when led into court, Barrows demurely attempts to obscure the handcuffs that have been put on her wrists.

Confronted by a surly and suspicious landlord, Bergen makes poetry of the rhetorical question, "Mr. Stone, do I look like the kind of person who'd be running a brothel?"

Chris Sarandon plays Barrows' adoring boyfriend, apparently a largely fictitious creation, and listens with deftly modulated astonishment when Barrows finally confesses why it is she's never invited him back to her apartment, also Cachet's conning tower. "I know this isn't exactly the kind of merchandising you talked about," she tells him, "but what I've done is, I've applied my ills to another market."

Barrows herself appears in the minor role of Peggy Eaton. Chita Rivera plays Barrows' friend Risa. Lou Antonio directed fairly nimbly.

Now that the TV-movie barrier has been crossed, it seems a natural for "Mayflower Madam" to become a series -- perhaps a wacky comedy. The fear of sexually transmitted diseases might work against that, but the series could actually dispense safe-sex information (something CBS wouldn't let the movie do).

This may be one of those ideas that at first glance seems preposterous and at second perfectly sensible. "Mayflower Madam" is, after all, a dynamite commercial title. In the film, Barrows chides a disapproving friend with, "Oh Pamela, show me a business where there's no sex involved." Certainly not television, honey!. 'Perry Mason'

Suggestion for the title of the next Perry Mason movie: "Perry Mason: The Case of Oh-Forget-It." Raymond Burr and Barbara Hale are still in relatively fine fettle as Perry and secretary Della Street, but NBC's Sunday night film, "The Case of the Scandalous Scoundrel" (Channel 4 at 9) is one trip too many to the well.

This time Robert Guillaume has the thankless role of the dirty rat whom everybody hates so that when he's killed there's a galaxy of potential culprits. "I think we could fill a football stadium with suspects," notes William Katt as Paul Drake Jr., the world's worst and most frequently beat-up detective. Katt has a really ridiculous new hairdo, but the coif to beat in the film is Yaphet Kotto's. He sports the kind of rug that makes Howard Cosell's look real.

Guillaume plays the publisher of Confidential Informer, a sleazy tabloid, and is a "vicious, sadistic hypocrite," in the words of a detractor. One wrinkle of the plot has him threatening Mason with blackmail on the grounds that Perry's been having a longstanding clandestine affair with Della! Mason, as it happens, doesn't deny the allegation.

As usual, Perry's client (Susan Wilder) is innocent and Burr spends the movie confronting other suspects in colorful locations. Of these, only Morgan Brittany gets any kind of sparkle going. Others include George Grizzard as a doctor with a past reminiscent of Claus von Bu low's.

Among the cheerful in-jokes is a conversation between Katt and Hale in which Drake's mother is mentioned; Hale is Katt's mother. The script was written by Anthony Spinner and directed with a certain understandable indifference by Christian Nyby.

Where the film collapses is where these "Mason" movies have all been weakest, in the courtroom scenes that wrap up the cases. Burr isn't all that mobile so he does much of his interrogating from a chair, looking like a talk show host at a microphone. The insufferable drag David Ogden Stiers plays the prosecutor without an ounce of energy. Executive producer Fred Silverman ought to do something about this.

Kotto, playing a retired military officer, may have the best, or at least most astute, line: "Mr. Mason," he announces, "has just overstayed his welcome.