I don't think there are fewer glitches in games today at all. If anything, I would put my money on there being more bugs and defects in shipping game software than in the past, simply because games are massively more complex than they were years ago -- many games these days ship with bugs, as evidenced by the number of day-one patches that exist for a lot of games.
There's no way to stop a programmer from making a mistake; the programmer (and most other game developers) operate in essentially a full-trust environment where they can do anything because they are creating the product. There are techniques that can help alleviate certain classifications of defects (unit testing, for example, smoke and regression tests, usability testing, et cetera), however.
Console games undergo fairly rigorous certification procedures that help catch some bugs -- but this was almost always the case, starting in some form or another with the NES. But as the plethora of tool-assisted speedrun videos for various NES games (which generally exploit bugs and glitches for fast completion), that didn't make those games bug free.
There's an argument that could be made that the increased complexity in art and visualization techniques for games tends to hide some bugs -- for example, as games approach a more realistic presentation, errant NPC behavior that is technically a bug might be perceived by a player as emergent. That doesn't mean that there isn't a software defect there, though.
It's very difficult to gather scientific evidence regarding bug count in shipping products, but I would say that if you were able you would either find that the numbers are relatively stable, or increasing. Decreasing seems quite unlikely.
One argument you could make for there being fewer bugs, however, is the fact that some games are built on existing engine technologies that have been iterating (and thus weeding bugs out) for years. However, this is not true of all games and any time an individual game adds a new feature to the engine or at the higher-level gameplay layer there's a risk of introducing a bug.