It’s because of similar guitar riffs. 
https://twitter.com/TeenVogue/status/854942728026808321
 
http://www.teenvogue.com/story/harry-styles-badfinger-claims
Badfinger has yet to address the fan speculation, and Harry's team did not have a comment.