You are correct that for small farms it makes little sense to grow grains, especially corn. It is neither sustainable nor profitable - the only grain I've known small farms to grow in my area (the northeast US) is sweetcorn, which is sold to specialty markets. Because grains are labor-intensive without expensive machinery, heavy nutrient feeders, and so cheap, on a home scale it makes sense to focus on higher-value crops.
However, the calculus is entirely different for industrial growers than it is for smallholder farmers. There are several factors that make grains very profitable for industrial growers:
(I'll focus on corn here, since it is the most produced grain in the US, but other grains follow similar patterns. I'll also focus on the US, since you used USD for prices, but much of this is applicable to other countries.)
The Green Revolution
With the advent of synthetic fertilizers, it became possible to sustain the intensive production of corn (a nutrient-heavy crop as you note) by adding large amounts of cheap fertilizer. Farmland that would be depleted by corn in a few years can now be kept in production indefinitely. Most industrial corn farms still rotate with soybeans, but grow corn most years. Fertilizers and new, expensive farm machinery favors large producers that can make use of economies of scale.
Farm Subsidies
This is probably the biggest "hidden reason." In the Great Depression, the US started subsidizing corn and other crops, but payments were made in exchange for farmers limiting production to keep prices high. In the 1970s, Secretary of Agriculture Earl Butz overhauled these policies so that farmers receive more subsidies for growing more acreage. Additionally, federally-subsidized crop insurance reduces the financial risk of crop failure. These subsidies make corn profitable despite the low prices that you point out - even if farmers are selling corn at a loss, the subsidies can make up for the difference and then some.
The policies of Earl Butz, along with the technological advancements of the Green Revolution, greatly favored large farms over small farms. You estimate a revenue of $2,700 per ha = $1,100 per acre, but most farms are now over 1,000 acres, meaning a revenue of over $1.1 million, not including subsidies.
Expanded Markets for Corn
The increase in production brought around by Earl Butz started a positive feedback loop, in which new markets are created to make use of the cheap corn. Some of these were engineered by the federal government, such as the export of grains overseas, and corn-derived ethanol. Over 30% of corn grown in the US now goes to producing ethanol fuel, which was initially subsidizes by the federal government. Additionally, the use of corn for livestock feed (instead of pasturing) has increased in response to the low price of corn. High-fructose corn syrup production is now also major market for corn. These markets further incentivize the production of corn.
For a more detailed overview of US policy surrounding grain production, see "Corn, Carbon, and Conservation: Rethinking U.S. Agricultural Policy in a Changing Global Environment" by Mary Jane Angelo (2010).