You need to have .Net 4.0 installed on the build server. The .Net 4.0 install will put the new MSBuild 4.0 which supports packaging web application projects.
Also, when you are running msbuild.exe make sure you are running the one that sits in the .Net 4.0 framework folder.