Hey Pepoluan!
You need to make ghost tracks for them to be placed. That way it knows where to lay them, as well as where to put bends and stuff.
Though I like the idea of actually just laying them straight on if there aren't any ghosts. I might add that when I'm in a factorio-modding-mood again.