Customizing Wordpress (apart from using themes) is very hard and it's all a bunch of spaghetti PHP code. Yet their marketshare keeps increasing over the years.
Why hasn't another CMS platform that is built with more modern languages (Ruby or Python, for example) been able to catch up to Wordpress?
What are they doing right which another CMS platform can replicate to increase marketshare?
Saying that customizing WordPress is hard "apart from using themes" (accuracy of that statement aside) is like saying computers don't come with that much information "apart from what's on the internet". The availability and ease of WordPress themes and plugins is a key part of WordPress' utility. You can't divorce those from any honest analysis.
WordPress is the dominant CMS for three reasons, and they all have to do with making the barrier to use extremely low.
1) It's flexible, without a significant learning curve. WordPress has really done an amazing job of making almost every core function available for 3rd-party developers to modify or build off of. For the end-user, that means there are themes and plugins available that let WordPress meet a vast spread of end-uses, from restaurant reservations to e-commerce store to personal blog to business site to portfolio to major media portal.
2) It's scalable, even without a great tech team. Say what you want about PHP / MySQL, but at this point we have ~20 years of experience making those technologies scalable. And with things like HHVM, we're still making improvements. Host your site on a service like WP Engine, install a recommended caching plugin, and you're able to handle a lot of traffic with very little developer assistance.
3) It's free, and its ecosystem runs on freemium. WordPress is free in every sense of the word. Open-source, no cost, and a huge amount of extra functionality available the same way. There are certainly excellent paid products for WordPress out there, but many of them work on a freemium model, so you don't even have to be a profitable enough scale to pay for that functionality before you both need it and can afford to pay for it.
From a development side, more people know PHP than Ruby or Python.
From a consumer side, PHP is more widely pre-installed and ready to use on servers than Ruby or Python.
Additionally, for the same reasons above, it makes it easier for more people to write plugins (free stuff to allow people to easily customize their site)..
Not saying PHP is good or bad, better or worse. Simplicity usually wins the game. All combined = more options than any other CMS can provide to the current market
You say customizing a Wordpress site is hard, but it really is not and that is the reason why it is so popular and why it is difficult for other CMS's to catch up. With a couple of additional plugins or themes (which are fairly easy to create or buy or find for free), anyone from a novice starter to an expert level programmer can quickly change their website into a social network, an e-commerce site, push out countless customizable landing pages, build a complex web application, easily integrate with phone gap to push out native applications across multiple mobile platforms, integrate with a ton of existing web services from ESPs to testing platform all with just a few clicks... Add in a robust community which has created in-depth tutorials and content to support every need, the cost of free, built on open source technologies and it really is no-brainer why it is so popular.
It also grows with the developer based on their needs offering a tiered product from hosted Wordpress.com to more advanced self-hosted Wordpress.org and the even more advanced Wordpress VIP for enterprises. This allows them to target entry-level bloggers at a mass scale and then be there every step of the way as they advance.