God, being God cannot have any limitation. Saying He cannot have a body is a limitation. If we read the scriptures, we find that God has been called both Sagun as well as Nirgun. Sagun has a form and Nirgun is formless. So, God can be without form. Whenever, He wishes, He can have any form He likes. Not only that, He can exist in various forms at the same time.
Ram was an incarnation of Vishnu. Ravan had the boon that he could not be killed by anybody other than a human. Moreover, in a previous birth Ravan was a doorkeeper, named Jay, in Vaikunth and because of a curse from Kumar brothers, he had to take birth on Earth. Vishnu decided that when Jay takes birth on Earth, then Vishnu himself would kill Ravan.
Now, how to fulfill both conditions. For this, Vishnu incarnated as a human. He did not use any divine qualities to kill Ravan.