HD is not the problem. They are an example of the problem which is effecting almost all brands here in the US. The decline in motorcycle sales in the US is not unique to HD, but they perhaps suffer the most and are the most visible. There are exceptions (R1200GS for one) in sales increase by some models. Many of the reasons mentioned above pretty much hit the nail on the head. It will be interesting to see if the investment by Royal Enfield in the US will meet their sales goals.
Meanwhile, in the rest of the world bikes sales rise as they are everyday transportation not the toys they are to us. The Bajaj Auto Company sold over 2.5 million motorcycles in 2017, and about 60% (1.5 million) were sold in one country-India. Honda worldwide sales were 17 million in fiscal 2016. Their US sales are a drop in the bucket (probably around 500,000).
For a young new rider to get into motorcycling he/she must buy a bike, buy the gear, pay for maintenance and insurance, operate the clutch, deal with weather issues, and keep hands empty to operate it. They can go get an old beater Corolla and drive out of the rain/sun with one hand free to text. And smaller, fun, economical bikes are not promoted-it's all about 100hp at the rear wheel, wheelies and behavior that is publicized and scorned at by most.
I am not surprised at declining bike sales.