Sam Spade makes the decision to turn Brigid into the police for the murder of Miles Archer. He knows that Gutman and the others, who Spade has already turned in, will explain everything that happened to the police to try and mitigate their jail time, as well as try to pin all the murders on him; Spade will be accused of murdering at least two people, possibly more, and since he has already committed several crimes, Spade's word will be suspect. Because Brigid actually did kill Miles Archer, Spade decides to turn her in; he believes that she will be treated better because she is a woman.
"...Don't be silly. You're taking the fall. One of us has got to take it... they'd hang me sure. You're likely to get a better break..."
(Hammett, The Maltese Falcon, Google Books)
Spade's worry is that he will be convicted of murdering Miles Archer (he has motive, as he and Archer's wife were having an affair) and possibly others, and murder was still a hanging offense when the novel was published. Spade knows that he will not be treated with lenience; his past record, his contentions with the police, and the fact that he would have to confess to the crime to protect Brigid all mean that he is much more likely to be convicted and hanged. Brigid is likely to be treated better, as a woman, and so turning her in saves Spade's life while ensuring that she is punished for killing Archer.