This is my take on it.
Shaw is so offensive because he destroys the Castle dynamics. However, I think that the inclusion of Shaw and the disruption he has caused in the team dynamics is purposeful. Mor specifically, Shaw's mission is to get Chuck ready to become a full fledged spy and to eliminate the blockades that are holding him back-- namely Casey and Sarah.
Think about it. Sarah and Casey had made some process with turning Chuck into a spy but in the last few seasons progress has been stagnant. Furthermore, Sarah poses a threat to halting any progress Chuck makes entirely because she is opposed to turning him into a spy-- something she feels will destroy the person she has come to like. It is no surprise, then, that Shaw has been called in. The government has one and one goal only in mind: develop Chuck into the perfect spy. And, lets face it, Chuck won't be a spy if Sarah and Casey keep holding him back
I believe that Shaw as sent in not to be Chuck's handler, but to be that of Sarah and Casey. Shaw is too perfect, too pretty, too smart, too Gary-Stu; no wonder much of fandom can not stand him He is to Sarah a new love interest, to Chuck a perfect teacher and model, and to Casey a new 'thing' to protect. But, isn't that the essence of a spy? To be exactly what the target wants you to be-- whether it is a lover, a friend, an informant. Shaw is exactly who he needs to be to accomplish his mission and I have no doubts that he is the type of man who does whatever it takes.
Shaw was sent in to turn Chuck into the perfect spy. This means cutting off his connections with Sarah and Casey. Since his first appearance, Shaw has been pushing Chuck. He 'removed his training wheels' so to speak, sending him on his own missions without Casey's militant backup and Sarah's coddling. For Chuck, there are no more 'flash-then-wait-in-the-car' moments while Casey and Sarah handle the dirty work. And, I hope you agree, in the last few episodes of the season, Chuck has grown exponentially as a spy. Chuck is now faced with real danger and can handle it mostly on his own.
And Sarah is none too happy about that. We know that Chuck won't become the perfect spy as long as Sarah holds him back. She already threatened to remove him from the spy business entirely in Prague and this is a threat that needs to be addressed. If the government were to remove Sarah and Casey outright, Chuck would never move forward. He is too close to them to allow that to happen and the Powers that Be know this. Therefore, they send in a wedge to drive the team apart and separate out the dead weight.
I then suggest that Shaw's real targets are Casey and Sarah. I will address how Shaw's perceived persona may be derived from the needs of his targets. Since Casey is easiest, I will examine his case first.
Casey's role in Castle is, undeniably, to help keep Chuck safe. When he and Chuck were starting out, there was no question that Chuck would need all the protection he could get. However, as Chuck has become more and more comfortable with his burgeoning role as a spy he is more able to handle his own problems. Shaw, however, has had quite a few disastrous moments with his term in Castle. His need to be rescued is, I believe, an attempt to distract Casey from Chuck. With Chuck needing little help and Shaw needing a caretaker it is little wonder that Casey is preoccupied with Shaw. While not 100% successful, the bit of breathing room that this removal has provided has encouraged Chuck to learn to fight his own battles.
Sarah is Chuck's closest connection in Castle and, arguably, holds the most sway over him. This means that Shaw's primary target must be Sarah. Lets take a look at where Sarah is emotionally prior to Shaw's introduction. She is doubting her decision to train Chuck to become a spy, worried that he is going to be destroyed as a result. Furthermore, she is heartbroken over Chuck's choice in Prague, which left her emotionally vulnerable and betrayed. She loves Chuck and it is killing her to lose him to the very profession she is trying to save him from.
Enter Shaw who, despite some initial misgivings, is kind and sweet and understanding. His story about a wife-come-partner and her tragic death appeal to Sarahs currently emotional state. This intimate connection with him has lead to her decreased guard and she begins to find in Shaw the things she feels she is missing from Chuck. She goes so far as to confide in Shaw her real name (if you are one of the people in fandom that believe that she was not plying him with false information) which is something she has never told Chuck, even when they were closest.
Shaw further severs the relationship with Sarah by replacing Chuck as her partner during missions, removing her contact with Chuck and forcing her to trust him. Then comes the kiss, the trip to D.C., the offer of a new station, and, finally, the Red Test. Shaw's insistence that Sarah issue Chuck's Red Test is the final barrier. Sarah will have forced the man she loved (loves?) to perform an act she has been trying to keep him away from. Chuck will be shocked that Sarah is the one who has handed him the gun. This double betrayal is only multiplied if Chuck follows through with the test. Shaw could have issued the Red Test himself, yes, but what better way to drive Sarah and Chuck apart than a loaded gun? Add to the immediate separation of Chuck and Sarah after the fact to prevent any sort of reconciliation.
Sarah and Chuck have been growing further and further apart all season. This deterioration started long before Shaw's inclusion into the team but he is the accelerant.
So, what can I conclude from this? There is much more to Shaw than fandom has seen. And, what we have seen may be a bold-faced lie played out as part of the Government's plan to turn Chuck and remove Sarah and Casey.
Shaw is a man willing to kill himself for a job, willing to put a bullet through his chest to complete a mission. Romancing Sarah with a sob story and acting helpless to fulfill Casey's need to protect something are skimming the surface of the pool of tricks he could use. He knows how to play the angles and I doubt he would have any qualms about playing the weaknesses of each team member. In fact, I think the notion of 'Saint Shaw' is a ruse he has developed to seduce Casey and Sarah away from Chuck, making it easier to manipulate them. After all, it is easier to catch a fly with honey than vinegar and, if we've learned anything, it is that Casey and Sarah have a soft spot for pretty, vulnerable, young spies.
If Shaw is as cold and calculating as I believe he is he may very well be one of my favorite characters. Personally, I feel that he is the most professional spy of the group. Sarah is too emotionally soft to play a real spy. Casey lacks subtly and restraint. Shaw's ability to manipulate, control, and execute may very well make him the most dangerous of the group.
I would love to hear what others have to say... but please, try to keep the Shaw bashing to a minimum, alright? I will try to respond as quickly as I can.
That being said I'm off to write some CaseyxAwesome slash... because there can't be enough Awesome.