The good news is that our atmosphere is mostly nitrogen. So this most precious of elements is also superabundant. The bad news is that only a few organisms on earth have learned the trick of taking gaseous nitrogen out of the air and incorporating it into their proteins. Part of the problem is that nitrogen in the air travels in pairs of atoms, and that they are extremely content in such a configuration. So content that there are no electrons hanging off for organisms to grab onto. This is why we fertilize our fields with things like ammonia. In ammonia nitrogen is in a form that is much more willing to part company with its neighbors and make up part of a new alliance, a protein in the body.
Taking nitrogen out of the air, then, is a very neat trick. It is known as nitrogen fixation, and only a few kinds of organisms can do it. All of them are very tiny. Modern phylogenetic classifications recognize them as belonging to two different kingdoms, the Bacteria and Archaea. What they all have in common is that they are prokaryotes, single-celled organisms that lack a nucleus. They are, to most of us who like trees and birds and things we can actually see, terribly boring. If you can get ahold of a microscope and get a look at one, you will see nothing but a small round or rod-shaped blob. Boring.
But what they lack in looks they make up for with their metabolic miracles, and nitrogen fixation is surely an example. So impressive is it that many larger and more charismatic organisms have found ways to set up house together with nitrogen fixing bacteria. The legumes are the most famous ones. Nitrogen fixing bacteria live in nodules on legume roots, almost certainly why legumes do so well even on marginal soils. Other plants also associate with nitrogen-fixing bacteria of various types. The photo below is from a Mexican cycad in the genus Zamia. Cycads have strange roots that grow upward out of the soil rather than down, known as "coraline roots" for their coral-like appearance. These roots are hollow and are home to photosynthetic nitrogen fixing blue-green algae (cyanobacteria). The roots grow out of the soil because the cyanobacteria need light to photosynthesize.
But I think that associating Moringa with nitrogen fixation also probably comes from the long tradition of mistaking Moringa for a legume. You may be forgiven for taking a Moringa for a legume. You would be in good company: Linnaeus thought that Moringa oleifera was a legume when he first described the plant (see my post on how Moringa oleifera got its name). For starters, most Moringa species have big pinnate leaves, just like most legumes. Second, Moringa flowers look very much like pea flowers, with a "banner" and a "keel." Third, the fruit in Moringa looks a little like the long pods of many legumes (though Moringa pods open up into three rather than two valves when they shed their seeds). I suspect that a lot of folks associate these general similarities with legumes, and therefore make the link that Moringa species might be nitrogen fixers.