I know it is haram to draw animate living things like animals and humans, but it is permissible to make pictures of trees and other inanimate objects based on the Hadith - Bukhari 2225, "Narrated Sa`id bin Abu Al-Hasan:

While I was with Ibn Abbas a man came and said, "O father of Abbas! My sustenance is from my manual profession and I make these pictures." Ibn Abbas said, "I will tell you only what I heard from Allah's Messenger (ﷺ) . I heard him saying, 'Whoever makes a picture will be punished by Allah till he puts life in it, and he will never be able to put life in it.' " Hearing this, that man heaved a sigh and his face turned pale. Ibn Abbas said to him, "What a pity! If you insist on making pictures I advise you to make pictures of trees and any other unanimated objects."

It is also known that the drawing of animate creatures is forbidden due to trying to replicate the creation of Allah from Bukhari 5963 - Narrated Ibn `Abbas:

I heard Muhammad saying, "Whoever makes a picture in this world will be asked to put life into it on the Day of Resurrection, but he will not be able to do so." But trees, mountains, and water are also the creation of Allah, so why are they permissible to draw?

Another reason for forbidding the drawing of animate creatures is to prevent people from worshipping these images. But there are also people who worship trees and celestial bodies like the sun and the moon, yet these are permissible to draw. What is the reason for this?