There are many reasons people give public talks. The term is very broad so for the sake of this small essay I would like to narrow it down to public talks at conferences -- which means they are usually prepared and performed in front of an interested audience. Sometimes giving such talks may be a full-time job. Imagine either a corporate evangelist or a professional trainer or guru. Still, it is more interesting to talk about casual speakers who do it for free.
Spreading ideas or memes is one of the basic needs of an intelligent being. It is very satisfying to see other people "infected" by your own thoughts, developing them, using them as a foundation for new theories and implementing them into projects. It is almost like being a father who sees his own features in his children.
Another reason, probably more rational, is using talks to invite people to reflect on a subject, to solicit feedback. In this case the wider and more targeted the audience, the better. Such speakers usually prefer more dialogue during their talks, they love questions and even more -- advice or critical opinions. They do not strive for perfection but may even intentionally leave holes or controversy in their talks to hook audience and make them give at least some feedback.
Some people really enjoy being a center of public interest and attention. They may regard their talks as shows, as works of art to be admired and applauded. Everyone needs his 15 minutes of fame and, to be honest, speaking at a conference is the rare chance for a lot of knowledge workers to become rock stars for a short moment. Ending a good talk to an ovation is an unforgettable moment. Speakers who aim for this effect usually include many jokes and funny pictures in their slides and sit long nights polishing every single word.
A rare type of speakers actually wants to share their knowledge and to enrich listeners. These people deserve most respect and may be distinguished by choosing the most hard subjects, sharing a lot of details and tailoring the talk at the time to better suit the audience's needs and demands.