It rained on the tourists long before the White House opened its visitors' gate yesterday morning, a bleak and quiet rain that rolled down their collars and smeared their eyeglasses and dampened their socks.

The tourists did not go away. They stood nobly in the rain like Wally Hanson of Syracuse, N.Y., whose pipe tobacco had begun to swim gently in his breast pocket, and who was bound and determined to see the White House.

Why, it was asked, did they persevere?

Hanson wiped the water from his nose and squared his shoulders. "Because we're stupid," he said.

There was a certain dogged patriotism to it all, this line of wet people huddled up against the wrought iron fence in the rain. "I think probably it's the only chance I'll probably ever have," said Hanson's wife, Grace. "Sort of an awesome feeling." Hanson muttered something unkind, but there he stayed, and the two of them stood bareheaded, patient Americans, waiting to see where the President lives.

Around Easter, in a sudden on slaught of station wagons and Greyhounds, the tourists come to Washington. Of course they visit in the winter months also, but it is in the spring, with its warm weather and the school vacations, that the pilgrimage begins in earnest: Elks clubs, traveling nuns, wandering tribes of high school students.

They come in such numbers that the Washington Monument admits them only on a reservations basis. At 8 a.m. the tickets go up for grabs at the kiosk below the monument; when they're gone you must wait until 6 p.m. to get in, and even then you stand in line.

Some people thought everybody in America would come to Washington last summer for the Bicentennial, but it didn't happen. Everybody in America heard about everybody else coming, so half of them stayed home, making the enormous crush less awful than the predictions. Now the hesitant seem to be visiting a year late: numbers are down from last year, but not by all that much.

All the Capitol, 217,510 visitors took the tours in April, 1976. This April, 201,748 people took them, a Capitol spokesman said. The Washington Monument had 158,292 visitors in April, 1976; this April it has 111,361. Hotel occupancy was at 80 per cent in April, 1977; a year earlier, it was 82.1 per cent.

The National Archives, on the other hand, is a very hot item these days. April and May of 1976 averaged 151, 300 visitors each to exhibition hall of the Archives; this April, 199,710 people stopped in. "We're just up about 200 a day," said Heidi Halter, and Archives public relations officer. Research visits are up, too; 5,498 daily visits in April 1976; 7,211 in April, 1977.

That is apparently Alex Hailey's doing, the Archives people say. Hailey's book "Roots," touched off a frenzied hunger for genealogical reserach, inspring a lot of tourists to look into their pasts while they're visiting. Some seem to be under the impression that they can do this in a couple of hours, Halter said - White House in the morning, roots in the afternoon, monument at sugset - and are disappointed to find out that it's more complicated than that. "It's educational, anyway," she said.

The Smithsonian also is doing very well, mostly because of the new and splendid Air and Space Museum, which drew 1,090,689 visitors just this April. Go in the evenings, the Smithsonian people say; all the museums except the Freer Gallery of Art are open until 9 every night, and by suppertime the crowds have gone away to eat.

They make the rounds with a fierce enthusiasm that is something to behold, these tourists. A young woman from Tewksbury, Mass., jounced her 4-year-old daughter gamely in the rain yesterday morning and said, "We've traveled a long way. We want to see everything . . . When you've seen it in a picture all your life and you see it for real, it gives you a different perspective."

And farther up, a pudgy and serious-looking 7-year-old named Jeremy Lanni, of Bayonne, N.J., explained that he hoped to see the President. "I'm just anxious to meet him," he said, rubbing his hands thoughtfully. Then, stricken with doubt about the nation's capital, he said, "Does it always rain like this?"