Why are miners allowed to not announce their mined blocks to the network? My question relates to a 51% Attack. As far as I understand, for this to work the miner must have a secret fork of the main blockchain, which he will later announce, whenever it becomes longer than the main blockchain, thus reverting a previous transaction and permitting double-spending.

So then, why not just force blocks into the main chain the moment they are mined? What is the rationale for these private forks?
"Why are miners allowed to not announce their mined blocks to the network?" you can not prohibit to mine blocks and not announce them. if you do some mining-calculations on your mining-hardware, you can do that offline. no one knows that until you publish your block(s).

"So then, why not just force blocks into the main chain the moment they are mined?" you can not know assuredly the timestamp when a block was mined because the miner can write an arbitrary timestamp in the block. furthermore all bitcoin-nodes/-miners should/will follow the longest block-chain by definition. the timestamps in the blocks does not really matter.

this "private mining" and resulting doublespend-attacks are absolutely possible. the bitcoin community trust that no one ever will have enough hashing-power to do this attack.