When the Republic of Turkey was declared, the new regime seems to have gone to a lot of effort to intentionally distinguish itself from the Ottoman Empire. The national capital was moved; the form of government was completely revised, and even some forms of traditional dress like the fez were banned.
Yet the national flag continued to remain virtually unchanged. In other situations (including the emergence of new governments during the same era, such as the Weimar Republic in Germany), the adoption of a new flag was a normal part of the transition. Why didn't Turkey do so?
The flag Turkey partially is the same as the Ottoman Empire. If you look, the Ottoman Empire had two official standards: the red one, representing the Sultanate, and the green one, representing the Caliphate. Here's an example. Like many countries' flags, the flag had been in use as a naval emblem for longer than it was in use as a national flag. The flag was officially adopted as a national emblem for the Ottoman Empire in 1844, as part of the modernizing Tanzimat reforms (this is also when the fez was introduced).
As for why it was kept, I can offer a few answers but none definitive. The following, as it relates directly to the flag, is somewhat speculative. First of all, while there was a large break between the Ottoman Empire (1299-1922) and the Turkish Republic (1923-), scholars like Erik Jan Zurcher argue that we should see a continuous "Young Turk Era" between the Young Turk takeover in 1908 (when the Ottoman sultan lost power to a nationalist band of military officers, eventually led by a triumvirate) and the Early Republican (aka Single Party) Era (1923-1945/1950). While the personnel was mostly different (Ataturk and a few other bridged the two eras), sociologically and in terms of many policies there's a large amount of continuity. If anyone is interested, I strongly strongly recommend Zurcher's twin articles "Young Turks: Children of the Borderlands?" and "How Europeans adopted Anatolia and created Turkey". Many of the ideas that were eventual adopted in the Turkish Republic were first proposed by the Young Turks. So while there is a sudden rupture, there's more transition than the date "1923" suggests.
Second, the flag remained the same, but what it signified changed. Partially. First of all, you'll see many people argue that a lot of Ataturk's support, especially in rural areas, is impart because he was seen as a traditional defender of Islam, a gazi (a traditional title for a person victorious in a religious war), rather than the Republican leader of a nationalist movement. To this day, if you say "Gazi", you're likely talking about Ataturk. He got a few other similar traditional religious titles, though most of these have fallen out of use and I do not remember. His secularizing reforms, I've argued, made little difference to religion in the countryside, with the exception of banning the Sufi orders (which in Turkey were more urban anyway) and having the call to prayer being recited in Turkish (which was a relatively late reform). He was seen by some as a savior of Muslims, rather than a savior of Turks specifically. This strange relationship between Turkey as secular, nationalist republic and Turkey as a (modern) homeland for the Ottoman Empire's (non-Arab) Muslims continues to the present day. The state may have maintained some of the same symbols because they helped give legitimacy to the rule, especially in the countryside. The flag is perhaps the only place I've heard the Arabic "el/al" in Modern Turkish (the flag is sometimes called Al Bayrak, or Al Sancak). If you read the lyrics to Turkey's national anthem, you'll see that they're explicitly about this flag (as it was flown during the Turkish War of Independence). The first line references the flag itself ("crimson banner" is a weak translation, though--a better translation would be "Fear not, unbeatable is this ruddy banner [al sancak] which floats in the dawns"), the third line references the "star of my nation" which "is going to shine" [forever], the fourth that this star is "mine". The second stanza starts with a reference to the "coy crescent", but in short, changing the flag would require changing the national anthem as well, as well as changing this symbol that had served as an important rallying point in the War of Independence.
But the meanings behind the symbols partially changed. The origin of the star and crescent is unclear--it has become associated with Islam generally, but actually pretty clearly was spread by the Ottoman Empire and doesn't really appear before the late Medieval period (centuries after the initial Arab conquests) and doesn't become common until the Modern era (17th/18th centuries). Still, if you read late Ottoman accounts of the flag's origins, you hear about a dream that Osman had. This is likely not true. Though I am not an expert on the early Ottoman Empire (my research is on Republican Turkey), I believe that we only have very late sources for this. What's interesting, though, is if you go around contemporary Turkey and ask people the origin of the star and crescent, often they will likely argue that it is a Republican symbol inspired by something Mustafa Kemal Atatürk saw at the Battle of Çanakkale (which in the West is called Galipoli)--a waking dream like vision of a star and the moon reflected in bloody on the ground. Which is to say, that to most people today it is not an Ottoman symbol, but an explicitly Republican one. There are further stories that this is not a Muslim or Ottoman symbol, or even a Republican one, but an ancient Turkic symbol which dates back to Central Asia. While associations with the Ottomans was negative, association with Central Asian pre-Seljuk Turks was not only kosher but highly encouraged. The first textbook for Turkish history published in the Republic famously gives many chapters to Central Asia and only a few pages to the Ottoman Empire. I haven't seen any research into when either of these new stories originate from, but it seems clear that even as the symbol itself remained unchanged, the Republican Turks changed the meaning of the symbol.
These sorts of reversals in the meaning of signifiers were common in this period of Turkish history: the fez represented modernity and order starting from the Tanzimat period (1839-1876), and backwardsness in the Early Republican Period a century later (it was banned by the Hat Law of 1925). Latin letters represented foreignness, but then they later simply represented modernity. Arabic and Persian loan words indicated education, but then represented foreignness and backwardsness.
So, while I can't be positive about when exactly the meaning of the symbols changed, I would venture it wasn't changed because it was initially useful in gaining support for the new Republican State from traditionally oriented groups, and then rather than changing the symbol itself, the meaning behind the symbol was changed.
Follow up - Why is the flag still used if Turkey is such a secular nation? Isn't the Crescent a blatantly Islamic symbol?
Edit: As mentioned in a comment above, the Crescent is derived from the symbol of the city of Istanbul. After being adopted by the Ottoman Empire, it was spread across the middle east. It is for this reason it remains on the flags of many Arabic nations today.