More than a dozen other artists, including Shakira, Selena Gomez, Drake and Taylor Swift are also affected. The original clips had been posted by Vevo.
Despacito has been removed, but its cover image had shown a group of people wearing masks and pointing guns.
The hackers, calling themselves Prosox and Kuroi'sh, had written "Free Palestine" underneath the videos.
Several of the clips remain live at time of writing.
Both YouTube and the music video hosting service Vevo have been contacted for comment.
A Twitter account that apparently belongs to one of the hackers posted: "It's just for fun, I just use [the] script 'youtube-change-title-video' and I write 'hacked'."
"Don't judge me I love YouTube," it added.
More about: YouTube