It's uncertain what "sustainable" means in this context. Glues tend not to be recycled or broken down to component parts at end of life. However, glues from renewable resources are available.
Flour glue could work reasonably well, but is not waterproof and not overly strong.
Blood glues (also called albumen glue) used to be a very major wood-glue and are still much used in specialist areas. There is much material on blood glues on web. They are waterproof and reasonably strong. Used for making eg plywood. Their are some very useful manuals and information sheets on web on glue making from the early to mid 20th century. One example:
Casein glue - overlaps with blood glue. Made from protein from bones, hide, sinews. Also from milk protein.
Egg albumen glue
I have many more references on disk and could dig out some of the more useful ones if of interest.
My understanding is that 3d printers melt the plastic while extruding, and it will solidify soon after beeng extruded. I don't see how to do that with glues
3D printers work by using whatever method they can make work.
Filament melting and resolidification is indeed one method - and proves to be a good but not a perfect one.
Others produce a layer of material in a "pond" which is set by UV or LASER or whatever at the surface in required places, then all moved down by one delta thickness and repeated. Others ... .
IF you can get a glue which tacks the material well enough immediately to hold it in place and which sets well enough in an acceptably short period to provide enough strength to allow model building to proceed then it will work.
The "trick" is to find materials and methods with acceptable values for "well enough", "acceptably short period" and "enough strength" :-). Doing this sort of thing is what leads to the sudden appearance of marvels of engineering which are obvious in retrospect but completely inobvious before someone had the lightbulb-inspiration that enabled them. Whether eg blood glue "wood" allow such a breakthrough is TBD. But, as you suggest, quite possibly not :-)