What WordPress 4.x Could Be
thomashunter.name
thomashunter.name
(after a Google search, it appears people have done this integration already)
Better idea: fork Wordpress into something called TemplatePress, implement a templating engine which does not allow for arbitrary php code in themes, and see how well people like it. Chances are it will be dead within a year-- people choose Wordpress because it is easy to modify it to their own needs. They don't care about maintainability or cleanliness or portability.
Existing Themes
The biggest asset of WordPress is the large number of themes and plugins available for it. Of course, by switching to a templating language such as Mustache, the existing repository of PHP based themes are no longer valid. To take care of this, Automattic (the company behind WordPress) could bundle a plugin with WordPress 4.x that allows loading of old templates, which would be disabled by default. Keeping that code out of core would help keep the overall project more manageable and secure.
Putting basic functionality in a plugin works with RoR because developers are used to it, but it is guaranteed to break if attempted with WordPress.
Having a clean theme is doable without ruining the work of the community.