When people swear to do something, they take an oath or a vow. [Interesting aside: The word 'vow' is related to the Spanish bodas (PIE, Grimm's Law, and so on.). Lorca was writing about a 'blood oath' when he wrote Bodas de Sangre. But I digress...]
They often solemnize the oath by involving blood - usually in one of three ways (or a mixture of two of them): sacrificing a victim, mixing the blood of the participants, or writing the agreement in blood. Colloquially, a strict contract* is often referred to as 'written in blood'.
b
PS And - another evocation of blood - the enforcer of a strict contract wants 'his pound of flesh' (Shylock, the money-lender in The Merchant of Venice first used the expression - though it's commonly used now as an everyday expression.) This is another example of the association of blood with a solemn contract (or oath).