Part of the challenge here might be your definition of "hot." When I think of "left overs", I see what is left over after eating a meal. It is certainly not "piping hot", as in just off the stove. There is no problem packaging, covering, and refrigerating these items. As an alternate example, when I make a batch of chicken stock, once it is cool enough in the pot to deal with so I don't burn myself, I portion it into deli containers for freezing. I cover (but sometimes don't completely seal, depending on how hot), and leave on the counter for 30 minutes to an hour before moving to the freezer. These are just examples.
It seems to me that (as at least one link in another answer here states) waiting until your food is room temperature might be problematic, as this could easily place it in the danger zone for some time.
Putting a lid on a deli container is only a problem if the items inside are so hot that the lid bulges. The issues is not food safety, but that the lid might be compromised or unseal.
Sealing does not cause spoilage. Spoilage bacteria do that under proper conditions of temperature and time.
Bottom line: Place your leftovers in a container, seal them, and refrigerate as soon as you are able to handle them, and within food safety parameters.