Let's think about the Exogorth or Space Slug in a real-life reality. What does a space-slug eat? How does it eat? How does it digest? You could compare the slug to a humpback whale.
Let's explore what we know. The slug, hides out in a hole in space waiting for its prey to come to it. If it hunted for food it would have exited the hole while the Falcon escaped. It is likely that passing 'food' does not come by often, so the life span of the slug could easily be thousands of years. It should also be able to survive long periods of time without food.
Instead the slug hides, blending into its surroundings, and waits with its mouth open to allow anything to come in. It also slowly closes its mouth instead of snapping it shut, probably so that the unsuspecting victim would remain unawares to its doom, similar to a Venus Fly trap.
Its digestion is probably very slow (as we see the Mynocks still alive and flying around). It may have a similar style of digestion as the Sarlacc in the Pit of Carkoon, who digests over a period of a thousand years. Or perhaps it stores its food alive untill it needs it. That said killing and chewing its food probably isn't on the 'top' of its priorities. You could argue that Mynocks and such are too small for the slug and it eats larger things, and wouldn't be concerned with 'digesting' them. However, if that where true, then it probably wouldn't have cared much if the Falcon escaped, as it too is rather small comparatively.
So, for arguments sake, the teeth would be used for trapping its food more than it would be either for chewing or killing. Further more they would more than likely look like in such away to not be obvious jaws of death, but disappear, so to speak.
What should further support this direction is when Leia say's that the cave is collapsing; it should appear as a 'cave collapsing' and not a obvious mouth with teeth. Our hero's aren’t that 'dumb'. If we can see that it's a mouth with teeth, they should too, right? You could even take it a step further, by Han's realization that it wasn't a cave. It implys he is familiar with 'space slugs', or their like, and wouldn't have been so easily dooped into going in one if it was so obvious as when they are coming out.
If we argue that it eats spaceships as it's main source of food, could only imply that the worm didn't exist before space travel was invented, otherwise what would it have eaten then? So, we cannot use that as a corner stone.