Hearkening back to the Western discussion I was supposed to comment on:
Weren't there some serializations that could be counted as novels written in the 19th century?
But that's not what I was asked. I don't agree that cowboy/country culture is itself extremely virtuous. The whole idea behind many traditional western stories is about how the ranchers (real cowboys) were at odds with the farmers (the cowboy and the farmer should be friends! claims Oklahoma!) But the issue is often one of who can hire the guns to hold it. Might makes right; hardly more virtuous than society that's developed extensive legal systems to break up monopolies (as just one example of city culture improving on the ethics of cowboy culture).
I think the reason women are "virtuous" (actually, just more traditional role typing) in westerns is that it's a more primitive society, with life being brutal, nasty, and short, to borrow a philosopher's words for it. When you need all the muscle you can just to work a living out of the ground, than you have to get along with the others with you, and team playing is more important. There's no room for social climbing or for wholesale manipulation (though it can happen much more subtly). Besides, there's nothing to be gained by being a loner, unless you can go the whole route and become like the Lone Ranger (and that doesn't get you ahead materially). So there's no point: you get control of your husband's land by killing him, and... then what? No one to run the farm/ranch. Plus it's pretty easy to figure out who did it when there isn't anyone around.
In crime fiction, however, the events take place in an established community. There's room for one person to manipulate, steal, and kill for personal advantage without destroying the entire society that you depend on to establish your wealth and position. Basically, crime fiction gives individuals the opportunity to gain status/wealth/power by manipulation/theft/intrigue/murder that just don't exist in the wild prarie.
Interestingly, both genres, by this account at least, treat women as having the same physical capacities: Women don't lead bands of thugs by intimidation and take land by force, or run protection rackets. They can't use brute tactics, so they gain the most advantage by being family supporters in westerns, or more illicit means in crime fiction
The essential change though is an overall shift in public perception of what women are capable of is, I think, the primary factor. In the 20's you start getting your flappers: morality is looser and women are more liberated in general: making a woman bad guy more believable.
I hope that was all coherant