Shenzhen is a new city and tech stuff are there because of the influence of Guangzhou as production hub and HK as facilitator for access to the west.
Beijing is more, let me say it, artistic. Is much more vibrant, culturally, than any other city in China. This kind of mix that you can find in New Work, Berlin or London also it brings innovation. So I don't think is meant to make the government "happy". Many Chinese tech company started in Beijing form many reasons: education, capital access, culture and so on. To give you an example: Mobike was founder by an ex journalist