First of all I never quite understood the meaning of get in the "have got" compound so I always assumed it is the "receive" meaning of "get"s many meanings.I guess "I have got ( received ) the present" probably means that you now have it. But I dont see how "have to do" can be equivalent to "have got to do". In short, why does "have got to do" mean "must".
As @snailplane said, it is an idiom, but here is how to think about it.
- I have something -- I possess it
- I have to do something -- I must do something
Presumably this "have to do something" usage evolves from the idea of possessing a task that must be done. It is something you "have on your to-do list".
- I have got something -- This also means that I possess it, because if I did get it in the past, then typically I possess it. Even though the fact that you did get something in the past doesn't automatically mean that you still have it, that case is so common that "I have got something" has essentially been reinterpreted to mean simple possession. (In American English, there is actually a distinction - "Have got" means "possess", and "have gotten" means "have received". But most of the globe doesn't use "gotten".)
- I have got to do something -- I must do it (It is an item that I have gotten on my to-do list somehow).
It is kind of a dumb thing that we use "have got" as a synonym for "have", but there you are.