lots of things can be the cause of spotting. I had spotting following sex and was told it was something to do with my cervix. I also know of women who have had spotting throughout their pregnancies and had healthy babies as well as those who sadly lost their babies.
Its impossible for anyone to say on here whats caused your spotting. Give your midwife a call or the early pregnancy unit at your hospital for advice and try not to be worried.
The fact that you had a good scan after some spotting is great though and I hope alls ok.
When you say you have an infection do you mean like thrush or cystitis? Cystitis if bad can cause blood in the urine which would also be fresh (bright red) blood.