And the magnitude of their betrayal - of colleagues, class and country -became a kind of metaphor for the diffuse loyalties of the British Establishment that not only inspired a generation of spy fiction, most notably that of John le Carre, but also fed into the middle-class counterreaction in British Conservative politics exemplified by the current Prime Minister, Margaret Thatcher, who maintains a mistrust for both the Foreign Office and career intelligence officers.

Harold Adrian Russell Philby, who was described by friends of the early 1940's as an immensely handsome and charming man who drank too much, stuttered badly and had an eye for pretty women, was born on New Year's Day, 1912, in Ambala, India. Son of Arab Scholar

His father, Harry St. John Bridger Philby, was a famous British figure of good family and colonial aspirations: an author, desert explorer, Arab scholar and friend of the only other Arabist of the time who would be more famous, T. E. Lawrence. In 1912, the senior Philby was a civil servant in the Indian Government; within a decade, he had been interior minister of Mesopotamia (Iraq), an adviser to Winston Churchill and chief British representative in Trans-Jordan; later he became a close adviser to the Saudi king, Ibn Saud, and the explorer of the desert vastness then known as the ''Empty Quarter of Arabia.'' In 1930, he resigned from the British Foreign Service and became a Moslem and took the name of Hajj Abdullah.

The younger Philby was known as Kim, after the hero of Rudyard Kipling's novel of that name, a young boy who serves his country as a spy. The young Mr. Philby had a brilliant record at Westminster School, one of Britain's finest public schools, and at Trinity College, Cambridge. There he became treasurer of the University Socialist Society.

The true timing and venue of Mr. Philby's recruitment by Soviet intelligence is unclear. He maintained that he was recruited not at Cambridge but in 1934, after a visit to Vienna and his first marriage, to Litzi Kohlman, an Austrian Communist. That marriage ended in divorce in 1938. Justified His Argument

In ''My Secret War,'' Mr. Philby justified his espionage with the argument that the Western democracies were too weak and corrupt to put up a struggle against the Germany of Adolf Hitler.

But Western intelligence officials have always believed the Mr. Philby lied about his recruitment to protect his friends and colleagues, and that by the time he left Cambridge, Mr. Philby was a Soviet agent, and that he may have carried out an initial probationary assignment in Vienna.