I started writing beat sheets, but I noticed it doesn't include details about history, society, lore, natural laws, etc. The issue with that is when you want to write a long story, the beat sheet won't help you avoid plot holes. So I am wondering if there's a standard way of organizing those ideas, instead of ending up with a lot of unrelated notes everywhere.
Well either they matter, or they don't matter.
It's certainly okay if they have no influence on the plot. But often the "environment" can play the role of an ally or antagonist in itself. A resistance movement may be an ally. A desert may be a life-threatening antagonist. A forest may provide food and protection, or predators and risk.
In the movie Castaway, The only antagonist for Tom Hanks is his environment; an uninhabited, uncharted island with both dangers and resources he, a corporate executive, must teach himself to survive on.
If the environment and cultures have no discernible influence on your plot, then plan that stuff in a separate document. It is just decorations that can provide some entertainment.
But I'd look deeper, first. Could your story just as easily take place on the Starship Enterprise, or Medieval London, or modern New York City?
If that is not true, then your environment does actually influence your plot, it constrains your characters in some way. You might want to think about how to use the environment to increase danger or provide opportunity within your story. Rivers for transportation, or roads. Difficult places to get to, but the characters must go there, it is the only place to get what they need. Time consuming travel when time is of the essence. Dangerous places that cause setbacks.
Like Castaway, like Lord of the Rings, overcoming the challenges of the environment can be a story in itself, or at least a significant plot driver.
Edit: When I say "could take place anywhere", I mean with obvious changes. For example, "Romeo and Juliet" can be told in many environments, and has been, the plot is barely influenced by the environment at all. While "Lord of the Rings" demands much travel, and the Ring can only be destroyed in one specific place that is hard to get to. The environment is essential to the plot, much like Castaway.
Standard way no, all authors do things a bit differently, but keep notes in whatever way makes sense to you for the project at hand as long as it lets you keep material together.
Personally I'll often jot things down in my phone memo sheet that I think might be important to a given story while I'm on the move and put them with the rest of that particular work later. The form that they are "properly" recorded in depends on how I'm working on the project in question; some pieces are purely handwritten while others I keep digitally. In all cases I'll have the material for a given project bundled together, some material may even be duplicated in more than one project bundle because I'm not sure it fits but I think it might be instructive. The bundle of writing may be a notebook or a file folder or an L file envelope full of foolscap sheets but regardless there will be dedicated pages, or files, for setting notes that I can refer back to.
Some of the material in those notes may be flavour text that I intend to use verbatim but that's quite rare; the vast majority of it concerns the nature of the world, the driving concepts I want to explore/base the world around, the physical laws, geography, etc... All of it is there for me as the author, designed to keep me on track, none of this setting material is ever designed to be presented directly to the reader/players although it informs everything that they do see.
Oh and never throw anything out completely, I regret every page of writing I've ever lost, or had destroyed, a lot of my older stuff is rubbish but looking at it still sparks ideas that I can now use with more skill and finesse than I possessed when I originally put it down.