WASHINGTON — The intelligence craft in American history and culture is a decidedly mixed bag. It has served up intrigue, genius and heroism, clever undercover operations and brain-boggling gadgetry, making it a linchpin of popular entertainment. Yet the spy trade also has a darker strain: Prone to epic failures and frequently in ethical trouble, the agencies have been embroiled in recent years in scandals involving brutal torture and secret surveillance.

Think Bond and Bourne vs. waterboarding and warrantless eavesdropping.

The challenge taken on by the new, vastly expanded International Spy Museum, opening May 12 in a striking glass-and-steel building not far from the National Mall, was to capture all of these disparate threads. The curators had to appeal to rambunctious 8-year-olds along with somber retirees, tourists whose notion of intelligence comes from “The Spy Who Loved Me” and (given its location) hypercritical visitors from the ranks of the C.I.A., the National Security Agency and all the secret crannies of the security state.

Overall, the new museum, built for $162 million from private donations and a municipal bond, does a remarkable job. It is more serious and realistic than the original Spy Museum, located a mile away and founded by the same man who financed most of the new museum, Milton Maltz, a television and radio entrepreneur. During its run from 2002 to 2018, the old museum became a popular gathering place for authors and speakers on spying, but some of the displays came across as slick and superficial.