I think the security of your website is not entirely dependent on the programming language you use to develop it.
Website security depends on various factors and programming language is one of them. Apart from that, it also includes used libraries and frameworks, coding practices, and regularly updated software.
Java, Python, PHP, Ruby are some of the secure programming languages.