the big advantage with having the same language on both ends is being to use server-side rendering (isomorphic). So your first page serve includes the initial rendering of the content, and then the client-side code takes over to handle changes with no refreshes.
If the client is written in a different language than the server then you have to maintain two versions of the page code to achieve this, and they have to be in perfect sync. Hard to do. Easier to write the code once and transpile to JS for the browser (or write the back end in JS).
If the client is written in a different language than the server then you have to maintain two versions of the page code to achieve this, and they have to be in perfect sync. Hard to do. Easier to write the code once and transpile to JS for the browser (or write the back end in JS).