It’s hard to tell the motivation of the American tourist in this case may have been. But he certainly knew that he would be photographed and fingerprinted upon arrival in Brazil, just as tourists here know what will happen to them upon arrival in the US. Both have to accept the situation or else stay home. Insulting immigration officers will obviously get one nowhere, in either country.