How to add some lines to the wp-login.php header via functions.php?

wp_head is for adding stuff in the head of the public/non-admin side of a WordPress site. For the standard login page for the admin screens, you can use login_head:

add_action( 'login_head', function () {
    echo '<meta name="viewport" content="width=device-width, user-scalable=no">';
} );