He was arrested as part of the Operation Elveden investigation into payments by newspapers to public officials.
Ostler appeared at the High Court this morning for sentencing.
His information, which he attempted to sell, contributed to the publication of a story headlined: "Rape fantasy fiend given NHS sex swap".
It was about a female patient who underwent gender reassignment to become a man and then later wanted to change back.
Despite asking for money, Ostler never received payment for the story as it was confirmed by another source, the court heard.
A second "aggravating" incident involved another attempt to sell a story about a "Broadmoor's Got Talent" contest at the hospital.
For this, Ostler received a "kill fee" of £250 because the story was not run by the newspaper he had been dealing with.
Judge Nicholas Hillard QC suspended Ostler’s sentence for 18 months and ordered him to do 150 hours of unpaid community service.
Handing down his sentence, Hillard said Ostler should receive full credit for pleading guilty at the “first reasonable opportunity”.
Outlining the nature of the offence, Hillard said: “You were employed by Broadmoor hospital as an Assistant Technical Instructor. You had been employed there for six years when in 2008 you made contact with a newspaper because you wanted to sell a story about a patient at the hospital where you worked and where as a result, you had obtained information which you passed on about the patient’s gender re-assignment process.
“It is quite plain from all the material I have seen that your motivation was financial, although in the event you did not receive any money for the information about this patient.
“Your offence is aggravated by the fact that you sought to establish a relationship with another newspaper for which the motivation was also commercial.”
Hillard described the offence at the “lower end of the scale” although warned that “offences of this kind will usually warrant a sentence of immediate imprisonment”.
Hillard said: “In all the circumstances of this particular case which I have outlined, in my judgment the proper course is to suspend the sentence of imprisonment which must be passed. In addition, you must be further punished by a requirement that you do unpaid work for the community.”
Email firstname.lastname@example.org to point out mistakes, provide story tips or send in a letter for publication on our "Letters Page" blog