I believe because you were synced to another iTunes library is why that happened. Can you go back to the App Store and re-download all your purchases? (You won't have to pay again. Just click on purchases.) You then should be able to get everything back in the one library where it can be synced again to your iPhone.