The grid does align with the monospace font -- each glyph is two blocks tall and one block wide.
It's a (not terribly effective in this case) way to help visualize the amount of indentation per line -- you can count grid spaces to determine the amount of indentation. (This is important in code: whitespace is significant in some languages, and in nearly all of them indentation is used as an organizing tool.)
Most text editors designed for code have something like this as an option (though yours is the first I've seen using a grid; the horizontal alignment doesn't really need emphasis -- and it particularly doesn't need to be cut in half as GNOME is doing. Most IDEs focus on just marking the verticals.) Here are three others using variations on the same idea -- left to right: Atom, Sublime Text, and a very outdated version of BBEdit.