Maybe you need to update Snow Leopard via combo update. It happens sometimes that an earlier version has problems with internet sharing (sometimes even an update could break it).
For example I could not establish successful Internet sharing on OS X Tiger 10.4.11, but with 10.5.8 I had the best experience.
For Snow Leopard, maybe you could try 10.6.8? 10.7.5 Internet sharing is working, although sometimes, it's not fully stable. It can be that you need to click on connected iPad/iPhone and same time on "Connect to" on established Bluetooth connection on the Mac to get it working.
The wireless card in your iMac, which is what is responsible for handling Wifi connections, is only capable of one connection at a time, to explain it most simply. The card cannot connect to a Wifi signal (your iPhone's Hotspot feature) and broadcast a signal at the same time.
However, a solution to what you wish to achieve may be possible if you can use USB Tethering as opposed to Wifi Hotspot on iPhone A. Then your wireless card on your iMac would be free to broadcast a Wifi signal for internet sharing.
I have not used any iPhone OS version since 3.1.2, where it was not called "hotspot" anywhere and the settings for tethering were even in a different set of menus. However, a quick search seems to show that you can activate USB tethering by going into your Personal Hotspot on the phone (Settings > General > Cellular > Personal Hotspot) while USB and Bluetooth are turned off. Then turning on Personal Hotspot, and tapping "USB Only" when prompted. USB tethering is also supposedly turned on even if Wifi and/or Bluetooth are on, yet I personally prefer to not have them on, and especially to not have the phone making a hotspot if I'm only going to use USB for connectivity.
Be advised, the iTunes Helper process is required to be running to provide the network interface for iPhone USB Tethering. This requires iTunes to be installed. If the iPhone does not initially provide you a network connection on your iMac, install if necessary and open iTunes, and it should start the iTunes Helper process and also add it to your login items.
At this point, your iMac should have a connection through your iPhone via USB. You can enable Wifi Internet Sharing in System Preferences and you should be good to go. Internet Sharing on most Macs, and I'm pretty certain on every modern one, produces a network in Infrastructure Mode. Which means there should be no problems connecting to it, even for devices that don't support certain other modes such as ad-hoc. So your other iPhone (B) should work fine.
Best Answer
personal hotspot without WiFi
iOS and OS X devices will use Bluetooth when possible over WiFi, so no need for the above.