The mandatory blood test (in the US, anyway) dates back to WWII era, I believe. A lot of men had syphilis or gonorreah and didn't know it, they would then unwittingly infect their wives, and often babies would be born blind, or adversely affected some other way. The blood test was a way of avoiding that.
Today the blood test laws vary from state to state; here in Michigan, for example, there is no longer a blood test required, but a couple must get mandatory AIDS counseling before they can get a marriage license.