The concept of them being blood brothers comes from a few kennings mentioned in Lokasenna and the Skaldskaparmal. Loki implies that a long time back, Odin and he mixed blood and implies a kind of kinship. Like was mentioned, Odin and Loki were good friends. Though Loki was known for his tricks and being sly/michevious at times, Odin came to him several times for various tasks or to seek some advice. They often traveled together, shared stories together, and really trusted each other- I believe. Outside of the few lines I mentioned, you never hear how they became blood brothers or why. But I assume it was because of their closeness, and Odin recognizing Loki's potential.