The sentence "You should of known better" derives from "You should've known better"; "should of" sounds about like the way you say "should've".
Of course "should've" is a contraction of "should have" - consequently it is correct to say either "You should have known better" or (being a bit informal) "You should've known better" but it is incorrect to WRITE "You should of known better" instead of "You should've known better."