The data field is only for when you want to create data-carrying transactions (ones with an OP_RETURN). This is generally not needed in normal transactions (and its usage there is somewhat controversial even). For coinbase transactions, you do need an OP_RETURN output with the witness commitment as specified in BIP141, if you want to include segwit transactions in your block.
However, you shouldn't use
createrawtransaction and related RPCs for constructing coinbase transactions, as they will miss the necessary scriptSig contents. Even if you could, it would most likely be so slow as to be useless (a modern miner like an AntMiner S17 needs 13000 coinbases per second). Thus, the miner firmware constructs them using hardcoded logic.
The field is marked as required in the RPC documentation for such outputs. If you don't want a data-carrying output, the object simply wouldn't exist.