In its judgement, the court asked the government to take steps to block access to the site for a month.
The court, which also described the movie as "offensive to Islam", ordered YouTube's suspension following a complaint by an Egyptian.
The low-production movie had sparked riots in parts of the Muslim world in which over 30 people were killed.
YouTube, a subsidiary of US Internet giant Google, had decided to restrict access to the movie for Internet users in several countries, among them Egypt, Libya, Indonesia and Saudi Arabia. The site has been blocked in Pakistan since December over the issue.