How to pass username into form that sends data to database

If you want to output the $id, you need to echo.
Also be sure to use esc_attr() as a good security practice.

<input type="hidden" name="id" value="[insert_php]echo esc_attr( $id );[/insert_php]">

In addition, as was noted in another answer, you’re calling it an ‘id’, but you’re actually using the login (username). If all you need is the numeric ID, use get_current_user_id().

<input type="hidden" name="id" value="[insert_php]echo esc_attr( get_current_user_id() );[/insert_php]">