The UK has "glaring gaps" in its military capabilities, a damning new report has warned.