Specifically, the 4th Amendment says:
The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no Warrants shall issue, but upon probable cause, supported by Oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.
So, do the police have the right to randomly search the bags of people getting on the T? Does it violate your 4th amendment right? The answers are clearly yes, and no.
Stick with me here...
Before you go crying foul, let me explain. The police can't walk up to you on the street and search you. You are protected. This is, of course, unless they have probable cause (aka, you are being stupid, and walk out of a bank with a ski mask and a handgun. Then, they can search you). Do the police have probable cause to do random searches on the T? Clearly not, otherwise they wouldn't be random. At this point, you are probably thinking to yourself that I don't know what I'm talking about, since I said earlier that the random searches were legal, but I said they didn't have probable cause for searches. Clearly, I must be insane. But wait, there is the issue of consent. If the police ask you to search your bag, and you say no, they can't search it. If you say yes, they can go nuts. So, do the police ask everyone whose bag they search if they can search it? Doubtful, but if you refuse to let them search your bag, you are well within your rights. At the same time, they are well within their rights to not let you on the train. They don't NEED to search your bag, if you don't want them to, but you don't really need to ride the T either. Get a taxi. You, as a potential passenger, are not guaranteed a ride on that train.
The most idiotic argument I heard was this: "If my son is out with his friends, smoking a joint, and is taking the T back, and gets stopped, he could be arrested if he forgot to take the weed out of his bag." As the Guiness commercials go, "Brilliant!" This lady has apparently never had the privilege of going to an airport on to Canada, where, you will be arrested for the same thing. If you are that dumb, to not check your own bag first, maybe you deserve to be arrested.
I personally don't like my bag searched as much as the next guy, but if you are going to come up with a reason to protest it, do your research, and come up with something a little more creative than illegal search and seizure. That is far too cliche.