One is never on very shaky ground when questioning the motives of a television network, so it is hardly reckless to speculate that NBC's new version of "The Diary of Anne Frank," at 9 tonight on Channel 4, did not come about for the noblest of reasons.

It provides another respectable vehicle for network star Melissa Gilbert, who last year appeared in a similarly negligible, unnecessary remake of "The Miracle Worker." And it presents an opportunity to cash in on the apparent marketability of TV movies about Nazis, territory opened up by "QB VII" and, later, "Holocaust."

The film itself does little to banish skeptical reservatons. In no way does it improve upon a perfectly satisfactory movie by George Stevens, and in most ways it is inferior. Director Boris Sagal stuck to the stage adaptation of the book and made the whole thing without a single exterior shot. a

The story takes place in the few small rooms in Amsterdam where Anne Frank, a young German girl, members of her family and four friends hid from the Nazis from 1942 to 1944, when they were discovered and, like millions of other Jews, exterminated. Limiting all scenes to those rooms would make sense if the play had been taped in continuous performance, like live TV drama. But on film, it simply seems cheap.

Gilbert is adequate as the young girl who must go through the typical teenage rites of adjustment even as the world is losing its mind. Scott Jacoby has no false moments as Peter, son of a couple also in hiding with the Frank family. But Melora Marshall, as Anne's sister Margot, registers most strongly, in a remarkably quiet, luminous way.

The emphasis is on the family's determination not to succumb to despair, but unfortunately this makes Maximilian Schell as the father, and others in the cast, appear merely naive, and Sagal is unable to make the horror of the outside world loom tangibly. The fugitives may have tried to forget what was happening, but if we do, there is little point to the play.

In two hours it never is able to touch the emotional power of a few ingenuous sentences from one of Anne Frank's last entries in her diary:

"It's really a wonder that I haven't dropped all my ideals, because they seem so absurd and impossible to carry out. Yet I keep them, because in spite of everything, I still believe that people are really good at heart . . .

"I see the world gradually being turned into a wilderness, I hear the ever-approaching thunder, which will destroy us too, I can feel the sufferings of millions and yet, if I look up into the heavens, I think that it will all come right, that this cruelty too will end, and that peace and tranquility will return again."