First, you did not uninstall .NET Framework 3.5 in Windows 7. .NET Framework 3.5 comes as part of Windows 7 and CANNOT be removed by a user.
Further, 3.5 has nothing to do with your .NET Framework 4.0 installation issue. The two versions are separate entities.
If the installer ran, there will be a log. Provide as follows:
Please collect your install logs with this:
http://www.microsoft.com/downloads/details.aspx?FamilyID=E0DA314F-6216-4A18-BC6B-7D29CF83AF20&displaylang=e&displaylang=en
After you run Collect.exe, you'll find vslogs.cab in your %temp% directory. Please upload vslogs.cab to a public site, like SkyDrive, and post the link here.