Both are grammatically correct. However, in #1 it would sound better to say "I prepared SOME soup for him".
"I prepared him soup" is stylistically weak because "him" can be misinterpreted as the direct object of "prepared". By contrast, "I gave him soup" would be a strong sentence. What's the difference between "give" and "prepare"? With "give", we have a strong expectation for an indirect object, whereas with "prepare" we have no such expectation. That is because the construction
GIVE (TO) SOMEBODY SOMETHING
is so very common, whereas PREPARE (FOR) SOMEBODY SOMETHING
is less common. Grammatically, however, there is no difference.