Infinitives are commonly used as adjectives or nouns. In your example, “to starve” is an adjective that modifies “elephant”. Grammatically, “the elephant is not to starve” is similar to “the elephant is not happy”. It is the same as if you created a sign saying “NOT TO STARVE” and attached it to the elephant. That would please the elephant who would be happy.