So, in the 24th century, advanced nanofactories are developed capable of producing any conceivable product; clothing, electronics, even nanotech, provided it is of inorganic nature. However, it is important in this project that organic products, (namely food) cannot be produced in a nanofactory. Why would this be?
In theory, a nanofactory can produce (complex) organic materials, but it is plausible that it is terrible at wet chemistry. I assume that is what you want, as even methane or plastics or complex carbon supermaterials are organic molecules, and you want to avoid foodstuffs. It turns out that special growth vats and bioreactors have too great a comparative advantage over the nanofactories, which themselves can be better if they exclude the organic manufacturing option.
If you require a reason bioreactors aren't used in homes or aren't freely available, say they benefit greatly from scaling up (which is probably true, consider the square-cube law). Alternatively, have them be restricted due to their greater danger. Homebuild super plagues aren't great for anyone.
Chemical reactions and nuclear reactions — two ways of turning things into other things — are easy. Both were done with 19th-century and mid-20th-century technology, respectively.
Folding proteins into the correct three-dimensional configurations, on the other hand, is exceptionally difficult; even today, supercomputers are required to simulate that accurately. And you need properly-folded proteins in order for a living organism to function.
Basically: the nanites can fabricate blocks of iron, or pillowcases, or computer chips, or build a nuclear reactor and transmute mercury to gold in it, because those things are fairly easy to compute, but they can't produce the complex organic molecules required to simulate, say, parsley, or a slab of beef. You won't even get something like Soylent out of the nanites; that contains proteins, so it's a no-go.
Every nanoassembler is restricted to not do that. Nobody with the skills to help alter this fact has ever decided to do so.
Mel finally gave in and wrote the code,
but he got the test backwards,
and, when the sense switch was turned on,
the program would cheat, winning every time.
Mel was delighted with this,
claiming his subconscious was uncontrollably ethical,
and adamantly refused to fix it.
— excerpt from The Story of Mel, originally by Ed Nather
Suppose your nanoassembler can produce biological matter. What's to stop that biological matter being pathogenic, and self-replicating? A software filter? Sounds like an NP-hard problem to me – and nothing a skilled team of hackers couldn't bypass, given physical access and enough time.
Per mass, most lethal diseases are incredibly efficient.
HIV, the virus that causes AIDS, has killed tens of millions of people worldwide, and over 30 million people are currently living with HIV. […] across all the people in the world, there probably exists about a spoonful worth of HIV. […]
If you gathered together all the viruses in all the humans in the world, they would fill about ten oil drums:
So the world currently has about a 200,000,000,000:1 oil reserve:human virus ratio. I'm sure this number has some economic significance.
— excerpt from What If #80: Pile of Viruses, by Randall Munroe
Unlike conventional bioengineering equipment, nanoassemblers are everywhere. Unlike conventional bioengineering equipment, home nanoassemblers can churn matter out by the kilogram. Industrial nanoassemblers can churn matter out by the tonne.
Conventional bioengineering processes, meanwhile, require the maintenance of very precise environments, specific to what you're trying to grow. A competent investigative body, in the proper regulatory environment, would have months of notice of an attempt to create biological weapons.
We all know how good cybersecurity is, especially for home devices. Nanoassemblers likely get pwned a few times a year. Incidentally, did you know you can just download the anthrax genome? Hey, did you know that most nanoassembler engineers have a nanoassembler where they sleep? Good luck convincing anyone to remove those restrictions.
But it's not enough to convince one person. Nanoassembly, as a field, is the intersection of quantum chemistry, discretised Lorentzian hydrodynamics, integro-differential p-adic analysis, and a dozen others. No one person, working alone, could hope to solve the amine fabrication problem. Nobody's even willing to attempt it (in public, at least); such research would mar their academic reputations for decades, if not life.
To make organic matter with a nanoassembler, it would take a conspiracy.
The party line is that there is something wrong with the food; potentially something dangerous. Nanoassemblers should not be used to print food.
In truth nanoassemblers print fine food. The food is good. But it is a slippery slope. The nanoassemblers can do better than food. They can print meat. They can print things that are alive. They can print things that are alive and that should not be alive.
They can do even better than that.
"Mad Cow Disease!"
I will piggyback onto @KEY_ABRADE's excellent protein folding-based answer and give an example of what @Willk's answer says:
They can (but t)he party line is that there is something wrong with the food; potentially something dangerous. Nanoassemblers should not be used to print food.
In addition to computational difficulty mentioned in @KEY_ABRADE's answer, the actual physical phenomenon of protein folding is pretty tricky and dynamic. Without recreating the complete cellular environment in which it takes place correctly, you could end up with alternate foldings that could be unhealthy, downright dangerous, or even potentially infectious!
From Wikipedia's Prion
Prions are misfolded proteins that have the ability to transmit their misfolded shape onto normal variants of the same protein. They characterize several fatal and transmissible neurodegenerative diseases in humans and many other animals. It is not known what causes a normal protein to misfold, but the resulting abnormal three-dimensional structure confers infectious properties by collapsing nearby protein molecules into the same shape.
Prion isoforms of the prion protein (PrP), whose specific function is uncertain, are hypothesized as the cause of transmissible spongiform encephalopathies (TSEs), including scrapie in sheep, chronic wasting disease (CWD) in deer, bovine spongiform encephalopathy (BSE) in cattle (commonly known as "mad cow disease") and Creutzfeldt–Jakob disease (CJD) in humans.
All known prion diseases in mammals affect the structure of the brain or other neural tissue; all are progressive, have no known effective treatment, and are always fatal. Until 2015, all known mammalian prion diseases were caused by the prion protein (PrP); however, in 2015 it was hypothesized that multiple system atrophy (MSA) was caused by a prion form of alpha-synuclein.
Complexity increases more than linearly when synthesizing
Pretty much self-explanatory. Your nano-machines have to control relative positions of atoms while creating a given molecule, which is the harder the more of them are in a single molecule of target matter. Next, you just have to make your printer create moecules instead of atoms, as say a single off-placed oxygen atom can catalyze a break of a molecule in an already assembled part of object, therefore it has to first produce a complete molecule then place it into the superstructure. And organic molecules are VERY complex, espectially proteins, to the point that they are created from less complex stable components in real life because even natural "nano-printers" cannot reproduce them in full at once.
So just make energy requirements to create complex molecules have a square component of the number of atoms in a molecule, and go with it. Creating proteins or polyfibers would then quickly become energetically prohibitive.
Nano-assemblers love organic things
In a nutshell:
The "write head" of the nanoassembler has to match the kind of material being assembled. So, the nanoassembler has a bunch of different write heads to suit every occasion: metals, plastics, glasses, fibers, etc.
The problem is that the write head used for organic compounds is itself organic, and it essentially tries to "eat" a lot of the material that it's supposed to be building with. In this context, "eat" is a crude gloss; rather, the materials in the write head react with or engage in catalyzing reactions with the materials being assembled. The result is that it does a pretty terrible job of assembling organic stuff.
Since this is such a reliable problem, they simply don't equip nanoassemblers with organic write heads, and the software alerts the user if a blueprint runs afoul of this limitation.
Your nanoassemblers can work with organic compounds. But because of a quirk of the carbon-oxygen assembly process, they deposit small quantities of 227 and 228Thorium on the finished product.
Usually, those trace quantities of Thorium will decay into non-dangerous amounts of gaseous Radon within a few months. Given decent ventilation, the Radon will harmlessly dissipate into the atmosphere.
Stuff made of mostly inorganic stuff has that problem, but to a much lesser degree - there's less Thorium and Radon on them, so a tiny amount of shielding or a few weeks of waiting means the health risk becomes negligible.
But stuff that goes inside your body, specially soon after being assembled? Given the quantities of radioactives involved, there's a real risk of cancer involved. Which means that assembling food has been only done in laboratories (where it's analyzed, not eaten) and in the black market (where it's eaten, and then people get sick).
It might be possible to synthesize foodstuffs with a long shelf life (longer than it takes for the radioactives to decay into safe levels), but they're bland-tasting stuffs that take a lot of room and time to "cure"; that room and time makes them very expensive in the end.
Feed Stock Limitations
There's a massive difference between nano-assemblers and replicators: nano-assemblers need materials to assemble, they can't just create whatever they need.
A nano-assembler takes molecules and pre-assembled blocks from its' feed stock and assembles them into complex objects. Generally the feed stock contains supplies of common molecules and building blocks that you need, and you can add specialized feed stock when you need it. The assembler platform itself uses nano-scale collector bots to fetch the appropriate molecules and convey them to the assembler bed, which maneuvers the molecule into the correct place in the big ol' jigsaw puzzle it's building.
So why not assemble a ham sandwich on your spare nanofac? Because you don't have feed stock for the hundreds of different building blocks you need to assemble a piece of ham, let alone the thousands of different types you need to put together the bread, salad, etc. And who in their right mind prints mustard. That's just heresy.
That's not to say that you couldn't set up a machine with all the right feed stock, but even at optimistic best speeds for nano-assembly you're going to have to rely pretty heavily on refrigeration and so on to make sure the feed stock doesn't go bad. And pray that your assembler never gets over about 60 degrees (Centigrade, 140 Fahrenheit) at any point in the process or the proteins will denature and all that fun stuff. Probably going to need a specialized printer just for biologicals, with a lot of extra functionality. They probably only exist in medical facilities to fabricate replacement organs and such from cultured cells.
(And in the Soylent factories. The original Soylent. You know, the green one. Because of course they would.)
Errors are Poison
As AlexP pointed out in a comment, clothing as we know it is organic.
So what is the difference between clothing and food? In short: Acceptable error rate.
So, these assemblers doesn't get everything right. This means bits of molecules connecting to the wrong other bits of molecules.
Now, what happens if you have a piece of clothing with errors? It will be weaker, but but perfectly usable.
And what happens if you have a piece of food with errors? You have poison. There will be all sorts of random molecules in there. Most of them will be bad for you. Poison.
Reason 1: They can, but they won't
Physically, it is possible to use a nanoassembler to make certain foodstuffs. However, the firmware controlling the assembly machine has been rigged to refuse to fabricate certain things. We see examples of something similar in real life: Modern printers will either refuse to scan currency or deliberately botch printing bills.
You would have to figure out why this is the case in your world. A possible idea is that your world's equivalent of the "organic" food lobby got its way and bribed enough politicians to pass a law making fabrication of certain items illegal.
Reason 2: It's inefficient
Sure, it may be possible to print food items without issue, but it takes too much energy to do so. Maybe it's much cheaper for the user to either grow or hunt his/her own food or buy it from someone who does. Perhaps the energy cost of using a nanoassembler makes the use of it worthwhile only if the desired item is otherwise expensive and/or extremely difficult to produce.
Reason 3: Too slow
Alternatively, it could be the case that the speed at which the nanoassembler fabricates an item is dependent almost entirely on the mass of the item that needs to be fabricated. Thus, fabricating an appreciable amount of fairly basic molecules is simply too slow to be worth the effort.
As an example, fabricating an object with a mass of 1 kilogram could take something like 200 hours. While it may be worth the wait if you want to fabricate, say, a computer, it's simply too slow to generate enough foodstuff for a person to sustain him/herself.
for the same reason you can't 3-d print guns
It's a threat to the safety of the public. Eventually, people will try to make pathogens, and what's gonna stop an extremist from making some batches of turbo-anthrax and letting it loose in a public square?
And the ethical issues
A nano assembler that can make organic things is basically a cloning pod. You could clone an organism so long as you can keep pumping it full of basic organic compounds. hell, you could theoretically create the Grand Clone Army of the Republic from StarWars in real life and have a slave army.
Frame challenge: It can make organic things, just not exceptionally complex things.
First and foremost, ‘organic’ does not mean what you seem to think it means. In scientific terms, ‘organic’ matter has complex non-crystalline carbon chains and rings as a primary component, while inorganic matter does not.
This distinction is important, because a huge number of things are actually organic that most people do not think of as such. Pretty much all widely used textiles are organic, including all commercially widespread synthetic fibers. Wool, silk, and cotton are obviously organic (wool and silk are actually polyamides, while cotton is mostly cellulose), but so are Rayon, polyamides (including Kevlar, Nomex, Nylon, Zytel, Amodel, Twaron, etc), elastane (Lycra/Spandex), polyesters, Olefin, and plenty of other things. Essentially, if you’re dealing with cloth and it’s spun from anything other than glass, metal, or mineral fibers, it’s organic.
The same is true of pretty much all plastics and rubbers, a vast majority of medications and cosmetology products, and even major parts of most electronics (pretty much all widely used insulation materials are actually organic).
And, rather interestingly, all of these have some rather useful properties for our dicussion:
- As typically used, they are very pure by typical standards of purity in organic chemistry (IOW, somewhere around 95% or higher purity).
- Impurities are almost always highly undesirable in these organic materials.
- Their chemical composition is very well characterized in 99.999% of cases.
Because of those three properties, these things are, in theory at least, very easy to assemble atom-by-atom like your nanoassembler probably would do. In fact, many of them should be far easier to assemble this way than they are to produce using ‘conventional’ chemistry.
However, food is rarely ever like that. Individual components of the flavor and texture of a food item may be like this, but as a general rule accurate reproduction of the flavor and texture requires a complex mix of chemicals that are often very poorly characterized. You may have heard of brewers or distillers talking about how important the water used when producing beer, scotch, or other alcoholic beverages is, and this complexity is a large part of why that actually matters, tiny trace amounts of specific chemicals in the water in a given locale can have a big impact on the taste of things made using that water.
As a different example, consider garlic. The smell of crushed garlic (and spicy flavor of garlic in cooked foods) is primarily a result of a chemical called allicin. This chemical, however, is not present in significant amounts in fresh, uncrushed garlic, it’s produced as a result of an enzymatic reaction that’s triggered when the garlic cells die off and rupture. Additionally, allicin slowly breaks down just above room temperature to produce a whole slew of other compounds that also contribute to the flavor of garlic in foods. If you just synthesize the allicin and never get it warm enough for that breakdown to occur, the end result will quite simply taste ‘wrong’, though you often won’t be able to tell why.
Given this, you have a pretty simple explanation for why your nanoassembler can’t produce (good) food: It quite simply can’t simultaneously process the sheer number of chemical compounds required to produce the flavor and texture properly. In theory, maybe it could produce protein bars, or some ‘optimized’ foodstuff that‘s very nutritious, but that’s not likely to taste any good, so it’s not really a reasonable solution to the issue of food scarcity except maybe for the military.
A specific variant of the safety concerns is that it has problems generating chiral molecules (the nano-assembler produces both the correct variant and its mirror image).
The specific concern is that practically all organic molecules are chiral and the mirror image can both be dangerous (Thalidomide is the classic example, but it is more complicated it seems) or just have the wrong taste (https://en.wikipedia.org/wiki/Carvone is an example).