There's usually quite a strong "time crunch" element. In my more snooty moods I say hackathons only teach bad habits and how to throw together software in a dreadfully hacky rushed manner. But in truth these are not always bad habits. Delivering a quick prototype to a tight deadline is a useful skill. I usually fail miserably at hackathons, which I find interesting. I think it means I should hone my dreadful hackery skills, because I can be too slow and considered and perfectionistic as a developer.
If it's all you practice, yeah you'll have had habits in longer software development. However, hackathons are good for figuring out how to reduce friction when you do need to sprint