For all those people that have spent an extensive amount of time trying to get the User Profile Service started.
You have all followed Spencer's fantastic article http://www.harbar.net/articles/sp2010ups.aspx as well TechNet http://technet.microsoft.com/en-us/library/ee721049.aspx and yet your User profile service fails to start i.e. status returns to "Stopped".
You will see errors in the ULS as below:
User Profile Application: SynchronizeMIIS encounters an exception: System.NullReferenceException: Object reference not set to an instance of an object.
ILM Configuration: Error 'ERR_CONFIG_DB'.
The farm I have been working on is Server 2012 R2, SharePoint 2013 (with the latest CU's installed) and SQL 2012.
The fix I applied was to take it back to the basics and make sure that all Pre-Requisites are correct.
What I found was that I have SQL 2012 Native client (to match my version of SQL) installed but the pre-requisites clearly say SQL 2008 R2 Native client is required.
I installed SQL 2008 R2 Native Client as a side by side to SQL 2012 Native client i.e. both are now installed on all servers in the farm and I then successfully started the User Profile Sync Service.
I have managed to replicate this on several farms.