It depends on whether you think you will ever have the chance to come to Asia again and how steeped into the culture you like to get when you travel.
Thailand and China can consume months of your life just as a tourist, but as you note, BKK and PEK can be done well-enough in five days.
I think of travel as a means of collecting stories that add to my overall life. For that reason, I would do both.
If you really want to get steeped into one culture or the other, then I'd pick ... not sure.
Both are great places. I've been in both during the time period you are looking at, for extended stays, and find Beijing unforgiving with its heat and humidity. That said, I find Chinese history and its role in contemporary politics much more interesting.
The rainy season in Thailand isn't as bad as you might think. Yes, you will see torrential downpours, but they are actually kinda cool. My memory is that they didn't ruin the entire day and that if you can put up with some flooding, it's not so bad.
BTW: If you fly from BKK to Tianjin you can take a
bullet train to Beijing. Air Asia flys this route and sometimes has great deals.
Hope you'll post a trip-report no matter what you do!