Some writers start with a title and then write the article. Other writers start with the article and then write a title. The writers who start with a title end up with better titles. The writers who start with a title tend to write better articles too.
Good writing conveys a single point. Titles keep your writing from meandering. Sometimes these meanderings lend themselves to new titles. That's fine. Titles are allowed to change. If a digression do not lend itself to a new title that means your writing has become disjointed. A title constrains your writing in a good way.
I was once hired to help another blogger create better titles for his blog posts. He is a good writer and a knowledgable person but his articles lacked punch. They felt aimless. I invented good titles for his articles. But the titles didn't work immediately. The blogger had to remove and rewrite large chunks of the articles that weren't germane to my titles. It would have been more efficient if he had just started with a good title in the first place. Also, his articles took longer to get to the point than they would have if he had started with a title.
Counterpoint: Sometimes you don't have a clear title because you don't have a clear understanding of what you want to say. Starting by writing and iterating can help you clarify your thoughts and eventually lead to a clear title & article once you're clearer on what you're thinking/want to say.
This is also sometimes recommended in songwriting, and has clear applications to other creative works (e.g. YouTube videos).
Interestingly enough, the overwhelming majority of pre-1900 music is not titled (see this list for some exceptions). Back in the old days, it was quite common to write a whole symphony and just publish it as "Symphony No. 1". More often than not, names that have become associated with a work (such as Bach's Brandenburg Concertos) were not even assigned by the composer.
Films too. An early version of this post mentioned YouTube videos explicitly. I didn't know about songwriting.