The heavier bullet takes just a little longer to get out of the barrel. As it is going down the barrel the gun has a little more time to recoil. So by the time the bullet exits, the muzzle end is ever so slightly higher than it would have been with a faster bullet. So heavy bullets shoot higher.
Funny thing is, I always hear this in terms of bullet weight. By the same logic (IMHO), as you increase the powder charge the bullets should hit lower. But I never hear this mentioned. I wonder if it also is true?