So why are sloths so slow? Sloths being slow is their main defense mechanism. Their claws are adapted to form a permanent hook to hang themselves to the tree branches, so they could literally live their whole life up on the tree tops. Their fur encourages bacteria growth which in turn promotes the growth of moss. So often sloths have green patches on their fur. This serves two purposes, one as an additional camouflage tools and second as an extra source of emergency nutrients, by licking them. This moss growth is only possible due to their lack of movements. Naturally, they have excellent camouflage and attract no attention at all. They are defenseless essentially, but that doesn’t pose a threat. The unlucky few are usually picked off by eagles due to terrible positioning or by jaguars when the sloths are occasionally on the forest floor to defecate and urinate, where are at their most vulnerable (because they are just polite that way). So yeah, sloths are moving slowly since it creates a perfect camouflage when they are hanging from the trees.
And here I have a happy sloth, isn't it lovely ;)