Usually this kind of task would be raster cross-tabulation (e.g. GRASS
cross-classification and tabulation,...) operations.
However, since the cell values in population raster can be anything (zero, and/or even 20 million), number of class (or combination) would be too many to expect a reasonable output.
Alternatively, let me suggest more vector-oriented way.
(1) SAGA Raster values to points tool (
QGIS Processing toolbox | SAGA | Vector <-> raster).
Just select your two raster layers. This tool will extract values and create a point layer.
(2) Open the attribute table of new point layer.
By the Field Calculator, create a new integer field by an expression:
sum("population", group_by:= to_int("type_of_settlement"))
(Please modify field names of above "population" and "type_of_settlement" as necessary).
New field has the total (sum of) population per the type of settlement.