There are a lot of audiences that are not satisfied with the ending, I think partly because they missed the various hints that the writer keeps throwing to us since the beginning of the drama which is, So Young has always been part Bong Hwan since the very beginning -- which influence both his behaviors and actions. And her presence is more apparent when she fainted and fell into vegetative state. So all the romantic actions we seen later are all her own doing and not Bong Hwan. You see Bong Hwan being confuse and hate those actions since it was always been So Young's doing. Bong Hwan just always tries to justified himself everytime he does something against his will to console himself since he can’t understand his action either (like imagining Hong Yeon when the Queen and the King had their first night together and any other various instances). So Young's memories, So Young's feelings, So Young's sync actions with her father, So Young's music ability, So Young's embroidery skills are the many hints that the writer throw to us.
The biggest hints:
Hint #1 - When Bong Hwan left the Queen's body in Episode 20, So Young knew he was gone since she cant felt his presence anymore -- she wasn’t ecstatic to get back, but she just felt he is gone since she never left her body in the first place. This indicates that she always there in her own body influencing all Bong Hwan's sub-conscience, behaviors and actions and do things against his wills.
Hint #2 - Bong Hwan was revealed as someone who never do justice (based on his conversation with Secretary Han on the balcony). This is the biggest hint that show us that all the helps the King received from the beginning from the Queen has always been So Young's doing. He influences Bong Hwan to do that way and in the end, Bong Hwan benefited from it as well and he become kinder and more towards justice and changed his destiny as well in the future.
Hint #3 - So Young never revealed to anyone that someone took over her body. Why? Because she know that she was always there in the beginning influencing Bong Hwan's behaviors and actions. Bong Hwan started to get So Young's memories one by one and can feel her emotions (thats why he knew that the Queen loves the King since the beginning and never love Byeong In). This later intensified when even when the Queen think, it was in So Young's voice instead of Bong Hwan. And later, the kiss, the first night which was done against Bong Hwan's will further proves this. And when we reached the end of the drama, we started to see less Bong Hwan and more of the Queen in term of action and decision makings. The personality of the Queen might be Bong Hwan, but the sub-conscious has always been So Young. Thats why she didnt feels guilty towards the King as well since she knew it was her that the King falls in love with.
I guess it comes to the question on who the King really fall in love with. The King starts to waver when the found out The Queen's grace behind her actions. She appears as someone arrogant & unruly (Bong Hwan) but she did something that help him with his dream of creating a better Joseon (So Young). So it was always been So Young's grace that made him fall in love with the Queen while Bong Hwan's un-princess like behaviors are the flaws (as he mentioned during his confession) that he accepted once he knew he had fallen in love with the Queen. In the end, it was So Young, the same little girl that he met when he was at his lowest point of his life -- the one who moves his heart -- the girl who fought for justice when she doesn’t need to considering the high status she’s in. But the writer did point out in the end that the King felt something is missing (Bong Hwan) when he looked at the Queen's Dictionary which I personally think is a nice touch to indicate he also appreciate Bong Hwan as well.
There's no injustice was done to Bong Hwan as once So Young is gone, his feelings towards the King is gone as well. His loves for the ladies didn’t fade even when the Queen finds himself falling for the King in the later part of the drama indicating the real Bong Hwan has never been gone -- he just co-exist with So Young at the same time. He still feel excited when he sees pretty women and wanted to be close to them even when he already accepted his confusing sexual identity. So now So Young is no longer part of him, he no longer feel attracted to the King anymore as can be seen at the end which he appears to happy & contented. Now So Young is no longer in his body, he just return to his former self.
And So Young has always had part of Bong Hwan's personality as well since in the beginning. Remember when she was called 'witch' by the court maids? When the King saw her terrorizing her court maid, it didn’t feel weird since she was like that as well before Bong Hwan entered her body. But after that, like how she influences Bong Hwan's to be more kinder and towards righteousness, Bong Hwan also influences her as well like how she can expressed herself more (through swearing) and now she can expressed more radical idea like court maids can get married at the end of the drama.
So due to this, I feel its truly a great ending. Everyone got what they want at the end and no injustice was done to any characters. They could go through the route that Bong Hwan accepted his fate to be in the Queen's body forever or Bong Hwan is the reincarnation of the Queen from the past life (which explain why his feelings to the ladies and the King legit as they are the same persons) but the writer chose this route which in my opinion is great as well.