Trump said he was being sarcastic. If that were true, and he was being sarcastic, it was EXTREMELY inappropriate.
He did not appear to me as being sarcastic. Therefore, his behavior was inappropriate...especially for a POTUS, so I would have to agree with you. Even if being sarcastic as he claims, it was not the place, and setting for the leader of the free world to say what he did.
I see that he has decided to make fewer appearances at the daily briefings. That is a good idea IMO.