Why did President Reagan send weapons to Iran if we were at war with them?
Real politic. We helped the Iraqis when they were losing then helped the Iranians when they were losing. Goals was to keep the two sides killing each other as long as possible so they could not make trouble for us in the region.
If I recall, we sent the weapons to Iraq not Iran
The thinking being we needed to get those a holes fighting each other in a detente to create a stalemate