jad1,
Welcome to FlyerTalk!
There are a number of things that cause secondary screening. Not getting in a frequent flyer number to your reservation prior to ticketing is probably the biggest reason. After that, last minute changes to tickets, particularly one-way tickets is next.
Whose fault is it? It is the TSA's fault for using these ineffective, un-American methods to harass the traveling public. However, it is also the airlines' fault for not standing up to the government and telling the TSA to go to hell.