Why is nitric acid often used to digest any solid sample?
This is pretty much correct. Nitric acid is a convenient oxidizing acid which will dissolve most of the metals (except for $\ce{Au}$, $\ce{Ta}$ and elements of platinum group), forming either oxides or nitrates; sulfur is oxidized to sulfate; phosphorus to phosphate; organics is oxidized and nitrated. This assures consistent predictable products in probe preparation.

Most oxides can be separated by filtering, and the majority of inorganic nitrates is soluble in aqueous solutions, which paves the way for the further classic analytical methods (titration, UV-Vis spectroscopy, atomic emission spectroscopy, etc.). Nitrate-ion is not prone to hydrolysis, and formed nitrates are no longer demonstrating oxidizing properties (unless they are solidified and heated), which is overall quite convenient.

Also, nitric acid is cheap and doesn't react with glass or PTFE, which allows to built various lab apparatus suitable for particular analytical method.