For the Soviet part: USSR food policy shifted in the early 1970's. They chose using grain imports (mostly from satellite countries, third world countries ^1 and USA) to balance surges and shortfalls in production. Those imports were very minor compared to domestic production (see the analyses below), so USSR didn't demonstrate weakness, perhaps used this trade as a propaganda. USSR experts can give more info on their part.
Let's see the USA part: Basically money came first even if their grain fed the enemy.
USSR's first grain purchase was in 1972, 19 million metric tons within 3 months. After that, Soviets purchased unexpected high amounts of grain from USA and this created some issues and disrupted domestic USA markets. US president Gerald R. Ford suspended grain export to USSR until a "US-USSR Long-Term Grain Trade Agreement" was negotiated and signed in 1975.^2
Here is the summary of the terms and conditions for the curious ^3 :
This agreement is presented to US public as "promoting American economic stability and a positive step in our relations with the Soviet Union" by Gerald R. Ford. ^4 AFAIK there were not much controversy at that time.
Agreement went well for both parts in the following years until Soviets invaded Afghanistan (a completely different topic) and USA issued an embargo to USSR between January 1980 to April 1981. This period was the most controversial and tricky part for USA: Honor the current agreement or completely withdraw it.
You can read detailed analyses of US National Security Council (NSC), another NSC discussion paper and US Department of The Treasury in unclassified "Secret" and "Confidential" CIA documents about the dilemma.
Those documents simply lists pros and cons of both honoring/withdrawing the agreement. They also mention European Economic Community (EEC) and the United States Department of Agriculture (USDA) were pressuring on US administration for a withdrawal.
At the end, newly elected US president R.Reagan decided to continue honoring the agreement and allowed seeking a renewal of the agreement (You can see US president Reagan's check marks on executive decisions in some of the documents linked above.) You can read the aftermath of Reagan's decisions in another unclassified "Secret" CIA document from 1985 on page 5:
As i said at the beginning, money came first ¯\(ツ)/¯
1 A friendly reminder that "third world country" term was originally used for neutral (read non-ally/non-axis during WW2) countries, not under-developed countries as used today.