Japan's economy grew at a weaker-than-expected rate in the second quarter despite an aggressive spending policy by the government.