Are you running this in Windows?
From https://wiki.gnome.org/Vala/ValaOnWindows :
In order to suppress the additional console window for GTK+ applications you have to take the following steps:
- Download MinGW API for MS-Windows
- Extract w32api-x.xx-mingw32-dev.tar.gz into the Vala/MinGW installation directory
Pass -X -mwindows to the Vala compiler:
valac -X -mwindows --pkg gtk+-2.0 hellogtk.vala