The second option is better to use. "I am writing to let you know that" is not repetitive like the first one. If you say "I am writing to you to let you know," then you will repeat yourself because "to let you know" implies the "to you" part.
For example, "I am writing to let you know that I am interested in your program and would like to work for your company."