I don't understand how they didn't prioritize food production, while at the same time guaranteeing jobs, education, and healthcare to everyone.
Price fixing is the short answer here. Since the government owned all enterprises, it was able to control consumer prices on all the goods. For propaganda purposes, the prices were very rarely raised. By constrast, government-paid nominal salaries increased steadily - Soviet central bank just printed more and more currency. In a market economy, expanding monetary supply not backed by real sector growth would have resulted in high inflation keeping real purchasing power of the people on the same level. However, Soviet centrally-planned economy was the total opposite of a free market, so the inflation became hidden and took form of a wide scale deficit on virtually anything. Typical grocery store shelves looked like this: http://ru-an.info/Photo/News/n4433/1.jpg
For the sake of completeness it is also worth mentioning that there existed a very limited free market of food produced by individuals. Most of the soviet citizens were granted a small plot of land (600 square meters) to grow vegetables or fruit trees, and to build a summer vacation home (called dacha). So many people farmed their own potatoes, cucumbers, tomatoes and such, some people kept chicken for eggs and meet. In rural areas, the plots allowed to be farmed individually were larger, so villagers could farm grain, corn or sunflower (for seeds) as well, or use the land for grazing of a cow. It was also typical to keep pigs or goats, some kept horses as work animals.
Back to the original topic of food market: the citizens were allowed to sell their self-grown food on the town markets, and the prices there were pretty much unregulated, so they were always higher than in state owned stores. With time, hidden inflation became worse and the price gap grew, by the 80s food on the market became 5-10 times more expensive than in the stores. A typical market looked like this: http://www.fresher.ru/manager_content/6-2017/kakimi-byli-rynki-v-sssr/4.jpg They haven't changed much since then, to be honest.
Another aspect of OP's question is increasing food production by the state-operated "collective farms" (kolkhoz). This was not easy since in late Soviet times neither kolkhoz directors nor the villagers had much motivation to improve productivity. In Stalin's times, possible accusation of sabotage followed by a prison term was good enough motivation, but later, as the repressions waned, arrests became rare. Financial motivation also did not exist since kolkhoz could not keep the profits and everyone's wages (including the director's) were fixed. So everyone slacked off, corruption and stealing of everything became commonplace. Central planning did not help productivity either. It was beyond kolkhoz's authority to decide what, when and how many resources they get: this includes machinery, fuel, fodder, seed material, fertilizers, pesticides, extra workforce etc. They even could not decide what crops/animals to grow considering available soil and climate, but had fixed output targets instead (See Khruschev's corn campaign). Meeting the planned target brought wage bonuses, but these were often not enough to motivate villagers, or in many cases target could not be met for reasons beyond their control (see below).
Resource management was at the discretion of Central Planning Agency ("Gosplan") in Moscow, and its local branches. If a kolkhoz director had personal connections in Gosplan and enthusiasm to lobby support, he could get necessary supplies and achieve high productivity. Otherwise, mismanagement was rampant. Supply of machinery and other resources was often inadequate and unreliable. Because of this, sowing and harvesting time was often missed. Morale of the workers was low, common problems were workplace theft and alcoholism.
For all the output that was produced, another layer of mismanagement was distributing it into the stores across the country. Storage and preservation techniques were very lousy, allowing much of the harvest to be stolen or simply rot. Centrally-planned distribution was highly uneven. Moscow, St Petersburg, republic capitals and closed cities (typically serving strategic military objects) had much higher priority in obtaining bulk food quantities. Rest of the country suffered. It had lower total supply, which was exacerbated by random fluctuations. Sometimes there was abundance of a particular product in one city, while at the same time the neighboring ones did not have it at all. People frequently traveled to another city to buy as much "deficit" (=scarce) goods as they could, to stock it up at home, or to barter for another "deficit" they couldn't obtain themselves.
Corruption at the point of sale was another problem. Workers at shops and warehouses frequently did not put "deficit" goods on the shelves, but instead bought them to re-sell at the back door with a significant price premium, or to barter with relatives and friends. Acquainting a porter or shopkeeper was a valuable connection back then, without it in the 80s you simply could not get most of the basic goods at all.
Source: I live in a post-Soviet country. I have seen myself or heard first hand accounts of most facts that I wrote here. Others I read in various first hand memoirs, printed and online, mostly in Russian (one of my two native languages).
Please feel free to ask follow ups, will try my best to answer.