It's not possible to say which is the better bike (better for what?) as they are too dissimilar. The KTM is a supermoto, intended for short distance hooning around, while the Ducati is a more of a general purpose bike. It would be a better bike for longer distance riding. I like both bikes and would be happy to own either. I've sat on both, the Ducati is a very good fit for me, it felt similar to a Street triple, while the KTM is comfortable enough for its intended purpose.
The KTM gets a lot of power from it's single cylinder, I suspect it will need careful maintainence and might not be a motor you would get high mileage from. It might not be all that user friendly for a new rider either, it will wheelie very easily. The Ducati will need expert maintainence too, the cam belts need to be changed every two years even if the bike is not used much and the valve clearances need adjusting by a specialist every 6,200 miles.
As you are posting in newbies I assume you are actually a new rider. The Ducati is certainly a better choice for a newbie than a 600cc race rep. However, I think you should consider buying a used bike to start on and get the Ducati/KTM later, when you have gained experience. It's very easy to damage a bike and cost yourself a lot of money to repair it.