Maybe not, though he did think it was at one point, and said he wouldn't stop working on Tor because of it (there's some on that in this transcript), but the interest might have been more because of wikileaks and a desire to infiltrate that network, not sure on the exact dates of all the stops, and after the Manning leaks wikileaks would probably be the main interest.
Whatever the reasons, I don't think it's justifiable to stop, question and search someone repeatedly like this without suspicion of a crime. If he's guilty of something, he should be charged, if not they shouldn't be using border agents for fishing expeditions and confiscating laptops/phones etc.
You are assuming that the fact that one part of the US government works on something implies that another part may not take a special interest in someone outside government that is involved with other aspects of it.
I don't see why you'd jump to that conclusion at all.
(Note that I have no opinion about this specific situation)