Was anything missing from your bag?
Was there a TSA slip inside the bag that explained that the TSA opened it? (If the TSA inspects a bag by hand they leave a paper slip inside to let you know your bag was opened)
I really doubt it was the TSA for a gate checked bag.
My guess is someone was stealing - or trying too.