USB wireless keyboard works from one USB port, but not the other
You can look at the USB device tree using the System Information application, launched either from the "System Report" button in the "About this Mac" dialog, or by looking in /Applications/Utilities.

Select usb from the sidebar and it will display the device tree. See if you get different information when you reconfigure your devices. 

Also look in the system log (via Console.app also in utilities) to see if there are any messages when you change your config.