I take Lexapro for anxiety and a little depression. It is a good med for sure. You are probably experiencing "start up" side effects which can include insomnia.
Many people take it in the morning to avoid nightime sleep issues. After a while you will be more accustomed to it and probably be able to take it whenever.
Also, I take 5mg twice a day (in the morning and after lunch), which seems to be better for me. Of course talk to your doc about all this, just my experience.
Anxiety Sufferer Since the 1980s
Lexapro @ 10mg per day
Trazodone as needed for sleep