The reason why digging holes was suggested is if it wasn't a useless economic activity it wouldn't be politically acceptable. If the government employed workers produced anything of value they would compete with private companies.
"It is curious how common sense, wriggling for an escape from absurd conclusions, has been apt to reach a preference for wholly ‘wasteful’ forms of loan expenditure rather than for partly wasteful forms, which, because they are not wholly wasteful, tend to be judged on strict ‘business’ principles. For example, unemployment relief financed by loans is more readily accepted than the financing of improvements at a charge below the current rate of interest; whilst the form of digging holes in the ground known as gold-mining, which not only adds nothing whatever to the real wealth of the world but involves the disutility of labour, is the most acceptable of all solutions." - Keynes
"It is curious how common sense, wriggling for an escape from absurd conclusions, has been apt to reach a preference for wholly ‘wasteful’ forms of loan expenditure rather than for partly wasteful forms, which, because they are not wholly wasteful, tend to be judged on strict ‘business’ principles. For example, unemployment relief financed by loans is more readily accepted than the financing of improvements at a charge below the current rate of interest; whilst the form of digging holes in the ground known as gold-mining, which not only adds nothing whatever to the real wealth of the world but involves the disutility of labour, is the most acceptable of all solutions." - Keynes