Judges can use their discretion in accepting or denying bail, but they must abide by the provisions established in section 515(10) of the Criminal Code. Under the law, a Judge can deny bail for any of these three reasons:
To guarantee that the accused person will appear in court as scheduled (such as if they are deemed a flight risk)
To protect the public (such as if there is a “substantial likelihood” they will commit an offence or endanger others upon release)
If, in their opinion, considering all circumstances, the accused person must remain in custody in order to “maintain confidence in the administration of justice” (often due to the gravity of the alleged offence and/or the strength of the case against them)