The first 了 means you did it, as past tense. The second 了 is as a modal particle. So you can also say: 我给小李打了电话。
If you say: 我给小李电话了. There are two meanings of this sentence. A: you called little Li. B : you gave the phone number.
我给了小李打电话 is not a correct sentence.