Oppenheimer’s relationship to the development of thermonuclear weapons (the “super" or “hydrogen bomb”) was substantially more complex than described here. In his 2015 book, Building the H Bomb, Kenneth W. Ford, who actually worked on the project at Los Alamos, tells a different story, as I described in my review of the book (linked above).
Edward Teller remained optimistic that the design, which came to be called the “Classical Super”, would work, but many others, including J. Robert Oppenheimer, Enrico Fermi, and Stanislaw Ulam, based upon the calculations that could be done at the time, concluded it would probably fail. Oppenheimer’s opposition to the Super or hydrogen bomb project has been presented as a moral opposition to development of such a weapon, but the author’s contemporary recollection is that it was based upon Oppenheimer’s belief that the classical super was unlikely to work, and that effort devoted to it would be at the expense of improved fission weapons which could be deployed in the near term.
All of this changed on March 9th, 1951. Edward Teller and Stanislaw Ulam published a report which presented a new approach to a fusion bomb. Unlike the classical super, which required the fusion fuel to burn on its own after being ignited, the new design, now called the Teller-Ulam design, compressed a capsule of fusion fuel by the radiation pressure of a fission detonation (usually, we don’t think of radiation as having pressure, but in the extreme conditions of a nuclear explosion it far exceeds pressures we encounter with matter), and then ignited it with a “spark plug” of fission fuel at the centre of the capsule. Unlike the classical super, the fusion fuel would burn at thermodynamic equilibrium and, in doing so, liberate abundant neutrons with such a high energy they would induce fission in Uranium-238 (which cannot be fissioned by the less energetic neutrons of a fission explosion), further increasing the yield.
Oppenheimer, who had been opposed to work upon fusion, pronounced the Teller-Ulam design “technically sweet” and immediately endorsed its development. The author’s interpretation is that once a design was in hand which appeared likely to work, there was no reason to believe that the Soviets who had, by that time, exploded their own fission bomb, would not also discover it and proceed to develop such a weapon, and hence it was important that the U.S. give priority to the fusion bomb to get there first. (Unlike the Soviet fission bomb, which was a copy of the U.S. implosion design based upon material obtained by espionage, there is no evidence the Soviet fusion bomb, first tested in 1955, was based upon espionage, but rather was an independent invention of the radiation implosion concept by Andrei Sakharov and Yakov Zel’dovich.)
A little-known fact about Oppenheimer is that in the 1939 paper “On Continued Gravitational Contraction” (full text [PDF]), he and Hartland Snyder predicted the collapse of massive stars into what, decades later, came to be called black holes. In this era, Einstein argued that such an object could never form because particles collapsing into it would have to exceed the speed of light. Many physicists believe that had Oppenheimer lived to see confirmation of the existence of black holes, he would have won the Nobel prize for this work.