Technically, it's called a presta valve nut, and if you're unfortunate enough to haunt the online bike forums, you've likely heard its utility/necessity debated ad infinitum and ad nauseum. It's the (usually knurled) metal donut that comes with every presta valve tube, designed to be threaded onto the valve once the tube is installed.
What's it supposed to do? Shoot, I was a mechanic for years, and I've ridden presta valves since the days I was tight-rolling my jeans, but I have no idea. I suppose it keeps you from pushing the valve down into the rim when you put a pump head on it (which, 99 times out of 100, the air pressure already in the tube will do, and in the other one time, your hand can suffice), or maybe it keeps the the valve perpendicular to the rim if your pressure gets low and the tire/tube rotates on the rim (though in that case, the valve is just going to get ripped out of the tube, a slightly more troubling development than a valve at a 70-degree angle).
In my experience, the only thing a dork nut does when installed in its intended location is slowly loosen and rattle. Thus, I don't use them on my wheels as designed... but I save and hoard them like precious currency. Why? Because they make great spacers. To whit:
Installing a bottle cage on your seat tube but the stupid front derailleur clamp is in the way? Dork nuts to the rescue! Note how one dork nut installed between cage and frame on each bottle brazeon creates just enough space to clear the clamp on my trusty Rockhopper. The knurled-ness just adds a bit of custom bling beyond an (equally functional but not as pretty) stack of washers. One is sufficient on the thin steel clamp of the vintage MTB front derailleurs I prefer (like the one shown), but you might need a stack of two per brazeon for the clunky clamps of Shimano's more modern offerings. Just make sure your bolts are long enough to engage the brazeon fully.
Another place where I often use a dork nut (though not on the current fleet, so you'll just have to imagine it without one of my terrible photos) is on the driveside rear rack/fender brazeon. If I install a rack or fender and find that the bolt protrudes beyond the brazeon enough to keep the chain from engaging the small cog, I'm usually way too lazy to find a shorter bolt or cut the one I have. A dork nut under the head of the bolt takes up that extra space with minimal effort, and I'm good to go. You can also hide the nut between the brazeon and whatever you happen to be mounting, but I'd be wary of doing too much of that with something load-bearing like a rack. Will a couple millimeters of extra leverage on that bolt really matter? Probably not, but why chance it?
Minutiae? Sure. But it's a good hack using something you probably already have littering your garage floor, at least if your garage floor is anything like mine.