When you knit one row, purl the next, you get a lovely flat fabric, but unfortunately it rolls, you can block it. Which is stretching it out and wetting or steaming it and pinning in place until it drys, but it will probably still roll.
To avoid this most hand made scarves are made with some kind of pattern on the edges.
Whoops re-reading your post, are you knitting every row for six rows? Then purling every row for six rows?