The men, along with several others, threw burning torches at the synagogue and two cars parked on the property, resulting in minor damage.
The attack took place just days after U.S. President Donald Trump recognized Jerusalem as Israel's capital.
The court sentenced two men to two years in prison and a third to one year and three months for threats and attempted criminal damage.
All three men had sought asylum in Sweden. Two - a Syrian national and a Palestinian resident in Syria have been given permanent residency. The third man - from Gaza - had his application rejected and will be deported.