Giraffes smell so bad for the same reason tourists do: to repel parasites.
(Explanation: in Laos, we heard a funny story about a tourist on the bus who noticed that no locals wanted to sit beside him. He got talking to a local kid and asked why this was, and the kid let him in on the secret: the locals reckon tourists stink of insect repellent. And they’re right) (Link)