First of all, Serena deserved the first code violation because her coach clearly signaled. It matters not one wit whether Serena saw the signal or not. The rule is clear and called far more often than many casual fans realize. The difference is that most matches where it's called have no further code violations so it never becomes an issue. For example, Nadal's coaches are cited quite often on the men's tour and Shapavalov's coach was cited during this very US Open.
Secondly, smashing a racquet is absolutely a code violation and gets called every time it occurs, no exceptions.
Thirdly, Serena clearly was verbally abusing the chair umpire and deserved the 3rd code violation. A player of her experience should have known better and my suspicion is that she felt the chair umpire would just take it because of who she is and the situation. Good for him.
Lastly, a brief story related to Serena's whining that she didn't cheat and would rather lose than do so. A few years ago she was playing Vika Azarenka, who reportedly is Serena's good friend off the court. Azarenka hit a drop shot and Serena raced to the net and did hit a winner, but in the process, before the ball had bounced twice on the other side of the net, clearly contacted the net with her foot. That should have been immediate loss of point and Azarenka who had seen it, looked to the chair umpire for a call. Unfortunately, the chair umpire claimed to not have seen it. The video replay showed quite clearly that by Serena's reaction. she knew she had contacted the net, but she adamantly argued she hadn't. The point went to Serena as called, but it was incredibly unsportsmanlike and definitely cheating.