You didn't do anything wrong during setup. By default, user "pi" can issue sudo commands with no password; that's the way Raspbian is released. If you haven't done very much other customizing, just re-flash the microSD card and start over.
If you really need to rescue the contents of the current card, flash a new card and boot the Pi from it. Put the current card into a USB adapter, plug it into a USB port, and you will be able to mount the partitions of the original card, edit files (with sudo) and fix your mistake. (At least, I think so; I haven't actually tested this.)
If you have physical access to a running Linux system, you could use that rather than flashing a second SD card for the Pi. Also note the comment and link from @goldilocks below about using a "live Linux" CD to get a running Linux system fairly easily.
To protect against breaking the sudo system, in the future use the visudo
command when editing sudo's files. It won't let you save a file with a syntax error.
For completeness, the following comes from the visudo man page web site:
visudo
parses the sudoers file after the edit and will not save the changes if there is a syntax error. Upon finding an error, visudo will print a message stating the line number(s) where the error occurred and the user will receive the “What now?” prompt. At this point the user may enter ‘e’ to re-edit the sudoers file, ‘x’ to exit without saving the changes, or ‘Q’ to quit and save changes. The ‘Q’ option should be used with extreme care because if visudo believes there to be a parse error, so will sudo and no one will be able to sudo again until the error is fixed. If ‘e’ is typed to edit the sudoers file after a parse error has been detected, the cursor will be placed on the line where the error occurred (if the editor supports this feature).
visudo
parses the sudoers file after the edit and will not save the changes if there is a syntax error. Upon finding an error, visudo will print a message stating the line number(s) where the error occurred and the user will receive the “What now?” prompt. At this point the user may enter ‘e’ to re-edit the sudoers file, ‘x’ to exit without saving the changes, or ‘Q’ to quit and save changes. The ‘Q’ option should be used with extreme care because if visudo believes there to be a parse error, so will sudo and no one will be able to sudo again until the error is fixed. If ‘e’ is typed to edit the sudoers file after a parse error has been detected, the cursor will be placed on the line where the error occurred (if the editor supports this feature).