It doesn't have to be profitable, that's just unavoidable. You've clearly not read documents like the UN roadmap to food security through to 2050 - which by my estimate just so happens to be when we could of obtained resources to sensible consider such ventures - or any similar such newer, by independant parties of interest.
To ignore the initial novelty factor of having "space food" the primary driving "marketing" ethos being the steadily spiraling populations of the Earth combined with the requirement to be building on the arable farming space required to feed said populations in order for residential and industrial support infrastructure, combined with "climate change" there will be a market for food, no matter where it's come from. Even our meager (in comparison) population will have significant expansion over but a few generations - not accounting for immigration.
Enough sunlight falls between the Earth and the moon - and hits neither - to realistically farm not only for our civilisation for a significant portion of it's expansion but also that of the entire Earth. Fish, fruit, and vegetables are all well and good, but basically we can do anything. Any environment tailored to suit. It's not a question of if we can do it, it's how can we get it done. To account for our population as it is now, as I compose this: 154344 (and counting) then it'd require 2701020m²(2701.03Km², or 10.45mi² or 27 hectare, or 66.718 acres) of aquaponics. I sense this figure doesn't take into account supporting infrastructutre. As well as assuming they would not breed it would also assume they are only interested in eating fish, fruit, vegetables or the rest of their lives. Realistically, such systems may indeed have their role, but the significant bulk would make sense to take place externally. Earth really isn't an option, by this stage they will struggle feeding themselves.
To sensibly consider for long term mass residential space habitation it would be prominent to establish supply chains "up there" first. As effectively we will be producing a lot of food we don't really need, at this stage, this can be sold to Earth for a little while in order to fund other initiatives. This capacity can be expanded as our manufacturing capacity expands, creating the possibility of creating mass habitation station. To realistically consider the construction of such structures it would first prequisite obtaining resources that are not sourced from Earth, the fighting of gravity prohibitively expensive at this time. That needs keeping to a minimal, and a torus a ½mile maybe a mile across isn't "minimal" (or, that's what I'd do.. per installation. "Small", easy to manage, and can be layed down in multiple over time to increase capacity. Internal surface area would be sufficient for several processes per installation. Rotation can simulate gravity with centrafugal force). By using materials obtained "from space" then it's possible to drastically reduce setup costs, if that's done right, they could be free and fast flowing from asteroid belt between Mars and Jupiter by 2050...