While I don't agree with TSA on how they handled this I suspect if the milk had been liquid it could have been screened by means other than xray.
Being frozen I think is the problem since something (remote possibility) could be hidden and concealed in the bag.
Just my 2 cents.
If people who have to endure TSA screenings had clear rules of what they must do to pass through a TSA Dragnet Checkpoint then these situations would not occur.