Hello
I don’t think you are doing anything wrong, I think this is just the nature of knitting and the characteristic of the stitches.
Stitches have 2 legs, as you knit one leg is pulled right and the other left and they are held in this pattern by the stitches below and above. At the end of a row though one of the legs is drawn upwards rather than to the side.
This is a nice video, full of info about purl bumps, perhaps you’ve watched it already. What I really like is when the purl bumps are used to create pattern rather than hidden.
I have made purposely switched colours back and forth across several row to make more purl bumps on both sides and varying patterns, before fully changing to the second colour. Something similar is shown in this video towards the end
If your making a scarf I can understand you’d like the edges neat and want a clean switch of colours. Have you considered a stitch pattern which is reversable as scarves are rarely viewed just from the right side? Or knitting a double layer (either in the round or seamed) which eliminates edge stitches and totally hides the wrong side.
Personally I like things to look a bit hand knit rather than shop bought.