The June performance represented a setback to hopes stronger construction activity will help support overall economic growth.
The decline in housing reflected a 1.4 percent fall in spending on single-family construction which offset a 2.5 percent rise in the smaller apartment sector. Even with the two months of declines, housing construction is still 7.4 percent above the level of a year ago.
The drop in non-residential activity reflected weakness in hotel construction and the category that includes shopping malls. Non-residential building is 11.2 percent higher than a year ago.
The 4 percent fall in government projects was the biggest one-month setback since government building tumbled by 6 percent in March 2002. The June weakness reflected a 5.2 percent decline in state and local government projects which offset a 10.4 percent rise in spending on federal building projects.
Government building activity has been constrained in recent years by the fall in tax revenue as a result of the Great Recession and efforts at the federal level to get soaring budget deficits under control.
A slump in construction in the winter contributed to the economy shrinking at an annual rate of 2.1 percent in the January-March quarter, the biggest decline since the first quarter of 2009 during the depths of the Great Recession.
Economists say a rebound to a 4 percent growth rate in the second quarter will be followed by solid growth of around 3 percent in the overall economy in the second half of this year.