A lot of agricultural foodstuff is terribly inefficient at meeting the goal of "keeping people from starving." We grow them though (and produce in the case of meat) because humans really enjoy them. If the main goal was to prevent starvation we wouldn't produce resource-intensive food products or we would produce them in moderation.
Agriculture's purpose is economic. Eating (and eating tasty food) does have a large demand though.