Leon Moore, 34, previously of Roots Lane, Catforth, Preston, has 17 convictions for 25 offences, including five for burglaries and was subject to a suspended jail term when he committed three offences in Blackburn.
Burnley Crown Court heard on March 10 last year he broke into the Al Islah High School, with worshippers at a nearby mosque spotting the damage.
Fingerprints at the scene were linked to Moore.He was arrested and bailed for that offence but went on to commit a burglary at the Masjid e Zainabia Mosque on May 24 this year.
Lewis Turner inquest: moped rider "travelling at motorway speeds" on residential New Longton road and without fastened helmet before fatal crash
M65 motorway crews strimming verges until 4am keep residents awake at night
Police urgently need to speak to "dangerous" Karl Bruney regarding a Ribbleton firearms incident last week
Real Housewives of Cheshire: former star of hit TV show set to visit Chorley boutique
Preston Brick Veil Mosque inquiry closes as debate rages over whether the place of worship should be permitted
Prosecuting, Catherine Ellis said: " A caretaker discovered a window at the side of the door was broken.
"A decorative candle had been stolen from the main hall and another door had been smashed to access a different part of the mosque.
"The defendant was identified from fingerprints at the entry point and found his way to another room where he left blood on the floor."
Moore appeared before magistrates on June 20 over the offences and was bailed again - but just 24 hours later committed a further break in at the Shia Islamic Centre.
Miss Ellis added: " According to a summary and witness statement the mosque was ransacked in the attempt to find property to steal.
"Two padlocks were broken and a door damage and a CCTV monitor was smashed, and there's reference to a general untidy search.
"The damage amounted to £150 and the main door had been kicked through."
Police identified Moore from CCTV footage and the clothing worn on it was found in his bedroom.
He admits three counts of burglary and breaching a suspended sentence order.
The court heard in 2017 he targeted the Olive School on Meins Road, the Islamiyah Girls High School on Willow Street and the Siddiqiyya Education Trust in Blackburn.
But defending, Clare Thomas said the offences were not racially motivated and were rather a reflection of the area he was in.
She told the court he was heavily under the influence of drugs
Recorder Philip Grundy, imposing 18 months, said: " You have an unenviable criminal record in more recent times certainly over the past five years you have been a regular attender at the courts for burglary with intent to steal in none dwellings.
"You've heard I reject any suggestion these offences were motivated by race.
"These were not planned burglaries in the true sense but were similar to your previous offences, you picking schools, mosques, and community centres as what you thought were an easy target."