The following is updated code from Ton Stegeman and it works.
private static void AddContentType(SPWeb web, SPList spList, string ctName)
{
if (web.AvailableContentTypes[(ctName)] != null)
{
SPContentType ContentType = web.AvailableContentTypes[ctName];
spList.ContentTypesEnabled = true;
spList.Update();
spList.ContentTypes.Add(ContentType);
spList.Update();
SPFolder rootFolder = spList.RootFolder;
SPContentType ct = spList.ContentTypes[ctName];
List<SPContentType> defaultCT = new List<SPContentType>();
defaultCT.Add(ct);
rootFolder.UniqueContentTypeOrder=defaultCT;
rootFolder.Update();
}
}