Is there a way to remove air from a container via a spell or other means? My DM is starting a new campaign with heavy survival elements, including food spoilage. He agrees that if I could seal spoil-able rations in an airtight container, they would last much longer.
Use basic canning techniques.
This is the method used by napoleon and the first use of large scale canning. Fill a bottle with cooked stew, insert cork, put bottle in water and bring to a boil and cook, allow to cool, boom sealed pasteurized food with no air. With spells that let you heat food directly or purify food while still in a sealed jar this is even more effective.
Depending on your campaign, certain actions may be easier or harder.
If you're a part of a lower-level campaign or a low-magic campaign, then that's where things get complicated. You should ask your DM what should be plausible to craft with your resources, but creating a vacuum-sealed environment given the right set of Artisan's Tools isn't impossible. For example, you could burn up all of the oxygen in a sealed space by putting a candle in a closed environment (probably a box), alongside the food. Despite it not being a 'vacuum-seal' by conventional means, it would effectively burn up all oxygen in the environment. Even if this specific idea doesn't work, a good DM will work with you to encourage creativity.
If you're a part of a high-magic campaign and the source of the spoilage is mold, your DM might allow the Purify Food and Drink spell to properly treat the food. Alternatively, Create Food and Water allows you to bypass finding food altogether. If your DM is nice enough, he may even allow you to exploit Mordenkainen's Magnificent Mansion. According to the spell's text, the mansion
contains sufficient food to serve a nine-course banquet for up to 100 people.
There are many ways to prevent food from spoiling.
You might want to consider the variety of ways that people preserved food before refrigeration, such as salting, spicing, smoking, pickling, and drying. Cheese is a way of preserving milk. Many foods such as nuts and root vegetables will last a long time without being treated, as will many staples, such as flour and corn meal.
In a society without refrigeration, food preservation is likely to be well-known by just about everyone, and certainly known by farmers, butchers, and others specializing in food preparation.
Is there a way to remove air from a container via a spell or other means?
There is an easy way — fill the container with water, and all the air inside will be displaced.
if I could seal spoil-able rations in an airtight container, they would last much longer
Well, this is not exactly true. Low oxygen environment does not prevent food from spoiling. For example, it is especially suited for Clostridium botulinum, the bacteria that causes botulism. You need to get rid of the existing bacteria first before sealing the container. Typically this can be made by freezing or boiling.
However, the very process of sterilization (or removing the air, for any means) does not make the container airtight. You probably need to use some kind of hermetic seal. As far as I know, grease and wax (thank you, @KorvinStarmast) were used for preserving food in the medieval times.